From cbe7f47df136246842c7e8e09d214d56507af878 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 20 Feb 2018 23:03:29 +0300 Subject: [PATCH] Fix 'anonymous type with no linkage used to declare variable' in GC source Issue #206 (bdwgc). * dyn_load.c [DARWIN] (GC_dyld_sections): Provide some name to struct. * finalize.c (GC_fnlz_roots): Likewise. * os_dep.c [MPROTECT_VDB && DARWIN] (GC_ports, GC_mprotect_thread_notify, GC_mprotect_thread): Likewise. --- dyn_load.c | 2 +- finalize.c | 2 +- os_dep.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dyn_load.c b/dyn_load.c index 9db31861b..c3cd186bd 100644 --- a/dyn_load.c +++ b/dyn_load.c @@ -1247,7 +1247,7 @@ GC_INNER void GC_register_dynamic_libraries(void) /*#define DARWIN_DEBUG*/ /* Writable sections generally available on Darwin. */ -STATIC const struct { +STATIC const struct dyld_sections_s { const char *seg; const char *sect; } GC_dyld_sections[] = { diff --git a/finalize.c b/finalize.c index 5132a252f..b16533420 100644 --- a/finalize.c +++ b/finalize.c @@ -71,7 +71,7 @@ struct finalizable_object { static signed_word log_fo_table_size = -1; -STATIC struct { +STATIC struct fnlz_roots_s { struct finalizable_object **fo_head; /* List of objects that should be finalized now: */ struct finalizable_object *finalize_now; diff --git a/os_dep.c b/os_dep.c index 6e6459191..cba23c318 100644 --- a/os_dep.c +++ b/os_dep.c @@ -3979,7 +3979,7 @@ static struct { thread_state_flavor_t flavors[MAX_EXCEPTION_PORTS]; } GC_old_exc_ports; -STATIC struct { +STATIC struct ports_s { void (*volatile os_callback[3])(void); mach_port_t exception; # if defined(THREADS) @@ -4022,7 +4022,7 @@ typedef enum { /* The following should ONLY be called when the world is stopped. */ STATIC void GC_mprotect_thread_notify(mach_msg_id_t id) { - struct { + struct buf_s { GC_msg_t msg; mach_msg_trailer_t trailer; } buf; @@ -4088,11 +4088,11 @@ STATIC void *GC_mprotect_thread(void *arg) /* These two structures contain some private kernel data. We don't */ /* need to access any of it so we don't bother defining a proper */ /* struct. The correct definitions are in the xnu source code. */ - struct { + struct reply_s { mach_msg_header_t head; char data[256]; } reply; - struct { + struct msg_s { mach_msg_header_t head; mach_msg_body_t msgh_body; char data[1024];