diff --git a/SConstruct b/SConstruct index 149951b026e8d86f9e298da7f8d59084763d8b0a..9349525eb22aa978f1a64015dbf3f6ce6cca97e3 100644 --- a/SConstruct +++ b/SConstruct @@ -118,8 +118,15 @@ if env['CC'] == 'cl': ] ) else: - # -Wno-clobbered only really works with gcc >= 4.2.x, but ... scons - env.MergeFlags('-std=c99 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-attributes -Wno-unused-variable') + if env['PLATFORM'] == 'darwin': + # It's reported -D_POSIX_C_SOURCE breaks the Mac OS build; I think we + # may need _DARWIN_C_SOURCE instead/in addition to, but let's wait to + # have access to a Mac to test/repo + env.MergeFlags('-std=c99 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-attributes -Wno-unused-variable') + else: + # Using -D_POSIX_C_SOURCE=200809L here, not on an ad-hoc basis when, + # #including, is important + env.MergeFlags('-std=c99 -D_POSIX_C_SOURCE=200809L -Wall -Wextra -Werror -Wno-unused-parameter -Wno-attributes -Wno-unused-variable') # Linker options if env['PLATFORM'] == 'darwin': diff --git a/src/tsearch.h b/src/tsearch.h index 7ba71d97502ca34908284560d0c156d2d29d9c37..7b297db7c7ea425f350f0d2c3350d55a630fb97b 100644 --- a/src/tsearch.h +++ b/src/tsearch.h @@ -20,7 +20,6 @@ void *tfind(const void *vkey, void * const *vrootp, int (*compar)(const void *, const void *)); #else -#define _POSIX_C_SOURCE 200809L #include <search.h> #endif