From 9141c97308d70ee432911af94c895033a521d654 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 23 Mar 2017 23:12:07 +0300 Subject: [PATCH] Fix finalize.c compilation in 'strict ANSI' mode This and some other GC .c files include gc_pmark.h directly (not gc_priv.h), so the compiler complains that sigset_t (used in gc_pthread_redirects.h) is undefined if 'strict ANSI' mode is on and _GNU_SOURCE is not defined before including system headers. * include/private/gc_pmark.h [(__linux__ || __GLIBC__ || __GNU__) && GC_PTHREADS && !GC_NO_PTHREAD_SIGMASK] (_GNU_SOURCE): Define (before including other headers). --- include/private/gc_pmark.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/private/gc_pmark.h b/include/private/gc_pmark.h index cb65f3d..1d48fe3 100644 --- a/include/private/gc_pmark.h +++ b/include/private/gc_pmark.h @@ -30,6 +30,12 @@ # define GC_BUILD #endif +#if (defined(__linux__) || defined(__GLIBC__) || defined(__GNU__)) \ + && !defined(_GNU_SOURCE) && defined(GC_PTHREADS) \ + && !defined(GC_NO_PTHREAD_SIGMASK) +# define _GNU_SOURCE 1 +#endif + #if defined(KEEP_BACK_PTRS) || defined(PRINT_BLACK_LIST) # include "dbg_mlc.h" #endif -- 2.7.4