From 72a2ada7f32d4485a7b39f4e22f1aa43ca045584 Mon Sep 17 00:00:00 2001 From: Jay Krell Date: Mon, 26 Feb 2018 07:53:37 +0300 Subject: Change Darwin-specific code to comply with C++11 standard Issue #206 (bdwgc). * darwin_stop_world.c (GC_stack_range_for): Cast pointer which is assinged to lo local variable to ptr_t (instead of void*). * os_dep.c [GC_DARWIN_THREADS && MPROTECT_VDB]: Include darwin_stop_world.h (so that GC_mprotect_stop and GC_mprotect_resume to be declared and later defined as extern "C"). * os_dep.c [MPROTECT_VDB && DARWIN] (exc_server, exception_raise, exception_raise_state): Wrap into extern "C" block; refine comment. * os_dep.c [MPROTECT_VDB && DARWIN] (catch_exception_raise_state, catch_exception_raise_state_identity): Declare as extern "C" (before the definition). * os_dep.c [MPROTECT_VDB && DARWIN && THREADS] (GC_mprotect_state): Initialize to GC_MP_NORMAL (instead of integer 0). --- darwin_stop_world.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'darwin_stop_world.c') diff --git a/darwin_stop_world.c b/darwin_stop_world.c index 3a8441e7..fd04fcd2 100644 --- a/darwin_stop_world.c +++ b/darwin_stop_world.c @@ -208,7 +208,7 @@ STATIC ptr_t GC_stack_range_for(ptr_t *phi, thread_act_t thread, GC_thread p, ABORT("thread_get_state failed"); # if defined(I386) - lo = (void *)state.THREAD_FLD(esp); + lo = (ptr_t)state.THREAD_FLD(esp); # ifndef DARWIN_DONT_PARSE_STACK *phi = GC_FindTopOfStack(state.THREAD_FLD(esp)); # endif @@ -221,7 +221,7 @@ STATIC ptr_t GC_stack_range_for(ptr_t *phi, thread_act_t thread, GC_thread p, GC_push_one(state.THREAD_FLD(ebp)); # elif defined(X86_64) - lo = (void *)state.THREAD_FLD(rsp); + lo = (ptr_t)state.THREAD_FLD(rsp); # ifndef DARWIN_DONT_PARSE_STACK *phi = GC_FindTopOfStack(state.THREAD_FLD(rsp)); # endif @@ -243,7 +243,7 @@ STATIC ptr_t GC_stack_range_for(ptr_t *phi, thread_act_t thread, GC_thread p, GC_push_one(state.THREAD_FLD(r15)); # elif defined(POWERPC) - lo = (void *)(state.THREAD_FLD(r1) - PPC_RED_ZONE_SIZE); + lo = (ptr_t)(state.THREAD_FLD(r1) - PPC_RED_ZONE_SIZE); # ifndef DARWIN_DONT_PARSE_STACK *phi = GC_FindTopOfStack(state.THREAD_FLD(r1)); # endif @@ -280,7 +280,7 @@ STATIC ptr_t GC_stack_range_for(ptr_t *phi, thread_act_t thread, GC_thread p, GC_push_one(state.THREAD_FLD(r31)); # elif defined(ARM32) - lo = (void *)state.THREAD_FLD(sp); + lo = (ptr_t)state.THREAD_FLD(sp); # ifndef DARWIN_DONT_PARSE_STACK *phi = GC_FindTopOfStack(state.THREAD_FLD(r[7])); /* fp */ # endif @@ -296,7 +296,7 @@ STATIC ptr_t GC_stack_range_for(ptr_t *phi, thread_act_t thread, GC_thread p, GC_push_one(state.THREAD_FLD(lr)); # elif defined(AARCH64) - lo = (void *)state.THREAD_FLD(sp); + lo = (ptr_t)state.THREAD_FLD(sp); # ifndef DARWIN_DONT_PARSE_STACK *phi = GC_FindTopOfStack(state.THREAD_FLD(fp)); # endif -- cgit v1.2.1