From 2d98a9b8ed79a68ea7ed3e34729d4a006e3fdd8e Mon Sep 17 00:00:00 2001 From: Josh Peterson Date: Thu, 2 Aug 2018 00:00:56 +0300 Subject: [PATCH] Fix the build for Emscripten (part of commit 0f9ef2d from Unity-Technologies/bdwgc) Issue #173 (bdwgc). * mark_rts.c [!CPPCHECK && __GNUC__>=4] (GC_approx_sp): Do not use __builtin_frame_address if STACK_NOT_SCANNED. --- mark_rts.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mark_rts.c b/mark_rts.c index 0cd7696..8ae0fc1 100644 --- a/mark_rts.c +++ b/mark_rts.c @@ -484,7 +484,8 @@ STATIC void GC_remove_tmp_roots(void) GC_INNER ptr_t GC_approx_sp(void) { volatile word sp; -# if defined(CPPCHECK) || (__GNUC__ >= 4) /* GC_GNUC_PREREQ(4, 0) */ +# if defined(CPPCHECK) || (__GNUC__ >= 4 /* GC_GNUC_PREREQ(4, 0) */ \ + && !defined(STACK_NOT_SCANNED)) /* TODO: Use GC_GNUC_PREREQ after fixing a bug in cppcheck. */ sp = (word)__builtin_frame_address(0); # else -- 2.7.4