Remove all _XOPEN_SOURCE defines in 'configure'

pull/214/head
WHR 2018-01-10 13:36:55 +08:00
parent 86f96a1e05
commit 1f45deaf38
3 changed files with 10 additions and 7 deletions

5
configure vendored
View File

@ -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 <unistd.h>" && 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 <unistd.h>' && break
done
echo "CC=$CC">config.mak

View File

@ -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 <limits.h>
#include <pthread.h>

View File

@ -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 <stdio.h>