From 1f45deaf384c6e6dfdee1c763074f5aed64ca709 Mon Sep 17 00:00:00 2001 From: WHR Date: Wed, 10 Jan 2018 13:36:55 +0800 Subject: [PATCH] Remove all _XOPEN_SOURCE defines in 'configure' --- configure | 5 +++-- src/allocator_thread.c | 5 +++-- src/main.c | 7 ++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 53f7285..e86a65a 100755 --- a/configure +++ b/configure @@ -164,8 +164,9 @@ check_compile_run 'whether OpenBSDs fclose() (illegally) calls close()' \ OUR_CPPFLAGS="$OUR_CPPFLAGS -DBROKEN_FCLOSE" } check_define __sun && check_define __SVR4 && solaris_detected=true -issolaris && for i in 700 600; do - check_compile_add_cppflag "whether _XOPEN_SOURCE=$i is suitable for C99 mode" "-D_XOPEN_SOURCE=$i" "#include " && break +issolaris && for i in 200809L 200112L; do + check_compile_add_cppflag "whether _POSIX_C_SOURCE=$i is suitable for C99 mode" "-DMAX_POSIX_VERSION=$i" \ + '#define _POSIX_C_SOURCE MAX_POSIX_VERSION\n#include ' && break done echo "CC=$CC">config.mak diff --git a/src/allocator_thread.c b/src/allocator_thread.c index cb4e987..b4dff8f 100644 --- a/src/allocator_thread.c +++ b/src/allocator_thread.c @@ -1,7 +1,8 @@ #undef _GNU_SOURCE #define _GNU_SOURCE -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 200809L +//#ifndef _POSIX_C_SOURCE +//#define _POSIX_C_SOURCE MAX_POSIX_VERSION +//#endif #define _DARWIN_C_SOURCE #include #include diff --git a/src/main.c b/src/main.c index 1f33003..6e61d73 100644 --- a/src/main.c +++ b/src/main.c @@ -7,9 +7,10 @@ * * ***************************************************************************/ -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 200809L -#ifndef _XOPEN_SOURCE +#ifndef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE MAX_POSIX_VERSION +#endif +#ifndef IS_SOLARIS #define _XOPEN_SOURCE 700 #endif #include