From 9caf77a48567af7ac8ea437824aa9609366f460a Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 1 Aug 1996 00:52:26 +0000 Subject: [PATCH] Put definition of _REENTRANT in config.h --- Include/allobjects.h | 6 -- Python/mystrtoul.c | 4 -- config.h.in | 3 + configure | 132 ++++++++++++++++++++++--------------------- configure.in | 1 + 5 files changed, 72 insertions(+), 74 deletions(-) diff --git a/Include/allobjects.h b/Include/allobjects.h index 1f55d1403d6..5e4925d73fe 100644 --- a/Include/allobjects.h +++ b/Include/allobjects.h @@ -41,12 +41,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define UsingSharedLibs #endif -#ifdef WITH_THREAD -/* This turns errno in a thread-safe function on Solaris. - Wonder what it will break though :-( */ -#define _REENTRANT -#endif - #include #include #include diff --git a/Python/mystrtoul.c b/Python/mystrtoul.c index 4181ea1f3dd..a6462837899 100644 --- a/Python/mystrtoul.c +++ b/Python/mystrtoul.c @@ -26,10 +26,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "config.h" #endif -#ifdef WITH_THREAD -#define _REENTRANT -#endif - /* Convert a possibly signed character to a nonnegative int */ /* XXX This assumes characters are 8 bits wide */ #ifdef __CHAR_UNSIGNED__ diff --git a/config.h.in b/config.h.in index 47773a50f18..903db9cf6c1 100644 --- a/config.h.in +++ b/config.h.in @@ -96,6 +96,9 @@ /* Define if you have POSIX threads */ #undef _POSIX_THREADS +/* Define to force use of thread-safe errno, h_errno, and other functions */ +#undef _REENTRANT + /* Define if setpgrp() must be called as setpgrp(0, 0). */ #undef SETPGRP_HAVE_ARG diff --git a/configure b/configure index 56d221e1b78..b637f159975 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh -# From configure.in Revision: 1.32 +# From configure.in Revision: 1.33 # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.10 @@ -1949,18 +1949,22 @@ echo "$ac_t""$withval" 1>&6 if test -d "$withval" then LIBS="$LIBS -L$withval" fi +cat >> confdefs.h <<\EOF +#define _REENTRANT 1 +EOF + ac_safe=`echo "mach/cthreads.h" | tr './\055' '___'` echo $ac_n "checking for mach/cthreads.h""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1964: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1994,7 +1998,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2040,7 +2044,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2092,7 +2096,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmpc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2135,7 +2139,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2238,7 +2242,7 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2291,7 +2295,7 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2340,7 +2344,7 @@ if eval "test \"`echo '$''{'ac_cv_func_getpgrp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_getpgrp=yes" else @@ -2377,7 +2381,7 @@ fi if eval "test \"`echo '$ac_cv_func_'getpgrp`\" = yes"; then echo "$ac_t""yes" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -2385,7 +2389,7 @@ int t() { getpgrp(0); ; return 0; } EOF -if { (eval echo configure:2389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define GETPGRP_HAVE_ARG 1 @@ -2403,7 +2407,7 @@ if eval "test \"`echo '$''{'ac_cv_func_setpgrp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_setpgrp=yes" else @@ -2440,7 +2444,7 @@ fi if eval "test \"`echo '$ac_cv_func_'setpgrp`\" = yes"; then echo "$ac_t""yes" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -2448,7 +2452,7 @@ int t() { setpgrp(0,0); ; return 0; } EOF -if { (eval echo configure:2452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define SETPGRP_HAVE_ARG 1 @@ -2466,7 +2470,7 @@ if eval "test \"`echo '$''{'ac_cv_func_gettimeofday'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_gettimeofday=yes" else @@ -2503,7 +2507,7 @@ fi if eval "test \"`echo '$ac_cv_func_'gettimeofday`\" = yes"; then echo "$ac_t""yes" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -2511,7 +2515,7 @@ int t() { gettimeofday((struct timeval*)0,(struct timezone*)0); ; return 0; } EOF -if { (eval echo configure:2515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else rm -rf conftest* @@ -2533,7 +2537,7 @@ if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2543,7 +2547,7 @@ int t() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:2547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2551: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -2567,7 +2571,7 @@ if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2576,7 +2580,7 @@ int t() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:2580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2584: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -2600,7 +2604,7 @@ if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -2609,7 +2613,7 @@ int t() { struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:2613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -2632,7 +2636,7 @@ if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -2643,7 +2647,7 @@ int t() { atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:2647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -2669,7 +2673,7 @@ if eval "test \"`echo '$''{'ac_cv_header_time_altzone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return 0; } @@ -2677,7 +2681,7 @@ int t() { return altzone; ; return 0; } EOF -if { (eval echo configure:2681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time_altzone=yes else @@ -2699,7 +2703,7 @@ fi was_it_defined=no echo $ac_n "checking whether sys/select.h and sys/time.h may both be included""... $ac_c" 1>&6 cat > conftest.$ac_ext < @@ -2711,7 +2715,7 @@ int t() { ; ; return 0; } EOF -if { (eval echo configure:2715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define SYS_SELECT_WITH_SYS_TIME 1 @@ -2731,7 +2735,7 @@ else if test "$GCC" = yes; then # GCC predefines this symbol on systems where it applies. cat > conftest.$ac_ext <&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:2771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then ac_cv_c_char_unsigned=yes else @@ -2788,7 +2792,7 @@ if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2861,7 +2865,7 @@ fi works=no echo $ac_n "checking for working volatile""... $ac_c" 1>&6 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2877: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* works=yes else @@ -2886,7 +2890,7 @@ echo "$ac_t""$works" 1>&6 works=no echo $ac_n "checking for working signed char""... $ac_c" 1>&6 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* works=yes else @@ -2911,7 +2915,7 @@ echo "$ac_t""$works" 1>&6 have_prototypes=no echo $ac_n "checking for prototypes""... $ac_c" 1>&6 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2927: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_PROTOTYPES 1 @@ -2933,7 +2937,7 @@ echo "$ac_t""$have_prototypes" 1>&6 works=no echo $ac_n "checking for variable length prototypes and stdarg.h""... $ac_c" 1>&6 cat > conftest.$ac_ext < @@ -2944,7 +2948,7 @@ int t() { return foo(10, 11, 12); ; return 0; } EOF -if { (eval echo configure:2948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_STDARG_PROTOTYPES 1 @@ -2959,7 +2963,7 @@ if test "$have_prototypes" = yes; then bad_prototypes=no echo $ac_n "checking for bad exec* prototypes""... $ac_c" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -2967,7 +2971,7 @@ int t() { char **t;execve("@",t,t); ; return 0; } EOF -if { (eval echo configure:2971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else rm -rf conftest* @@ -2987,7 +2991,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:3011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then : else @@ -3019,7 +3023,7 @@ echo "$ac_t""$bad_forward" 1>&6 va_list_is_array=no echo $ac_n "checking whether va_list is an array""... $ac_c" 1>&6 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else rm -rf conftest* @@ -3058,7 +3062,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lieee $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3132,7 +3136,7 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3189,7 +3193,7 @@ else ac_cv_func_getopt=no else cat > conftest.$ac_ext < extern int optind, opterr, getopt(); @@ -3201,7 +3205,7 @@ int main() { exit(0); } EOF -{ (eval echo configure:3205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:3209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then ac_cv_func_getopt=yes else diff --git a/configure.in b/configure.in index 226ab686997..f74651cbd51 100644 --- a/configure.in +++ b/configure.in @@ -247,6 +247,7 @@ AC_MSG_RESULT($withval) if test -d "$withval" then LIBS="$LIBS -L$withval" fi +AC_DEFINE(_REENTRANT) AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD) AC_DEFINE(C_THREADS) LIBOBJS="$LIBOBJS thread.o"],[