From ec93954362aa132ab9695986484d211fd323869d Mon Sep 17 00:00:00 2001 From: "wchang0222%aol.com" Date: Sun, 16 Nov 2003 01:10:49 +0000 Subject: [PATCH] Bugzilla bug 219913: define _PR_HAVE_THREADSAFE_GETHOST for OS/2 so that we can issue concurrent gethostbyname calls. Moved the definition of _PR_GLOBAL_THREADS_ONLY, BSD_SELECT, and TCPV40HDRS from configure.in to _os2.h. Modified files: configure configure.in _os2.h --- nsprpub/configure | 54 +++++++++++++----------------------- nsprpub/configure.in | 4 --- nsprpub/pr/include/md/_os2.h | 6 +++- 3 files changed, 24 insertions(+), 40 deletions(-) diff --git a/nsprpub/configure b/nsprpub/configure index 9a5bb9215258..aa1fa38aa525 100755 --- a/nsprpub/configure +++ b/nsprpub/configure @@ -4626,14 +4626,6 @@ EOF cat >> confdefs.h <<\EOF #define XP_PC 1 -EOF - - cat >> confdefs.h <<\EOF -#define BSD_SELECT 1 -EOF - - cat >> confdefs.h <<\EOF -#define _PR_GLOBAL_THREADS_ONLY 1 EOF LIB_SUFFIX=lib @@ -4653,10 +4645,6 @@ EOF cat >> confdefs.h <<\EOF #define OS2 1 -EOF - - cat >> confdefs.h <<\EOF -#define TCPV40HDRS 1 EOF AR=emxomfar @@ -4686,10 +4674,6 @@ EOF cat >> confdefs.h <<\EOF #define OS2 4 -EOF - - cat >> confdefs.h <<\EOF -#define TCPV40HDRS 1 EOF cat >> confdefs.h <<\EOF @@ -4750,7 +4734,7 @@ case $target in ;; *) echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4754: checking for dlopen in -ldl" >&5 +echo "configure:4738: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4758,7 +4742,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4786,17 +4770,17 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:4790: checking for dlfcn.h" >&5 +echo "configure:4774: checking for dlfcn.h" >&5 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:4800: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4829,13 +4813,13 @@ esac if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:4833: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:4817: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -4853,7 +4837,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -4877,12 +4861,12 @@ fi for ac_func in lchown strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4881: checking for $ac_func" >&5 +echo "configure:4865: checking for $ac_func" >&5 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; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4944,7 +4928,7 @@ hpux*) if test -z "$GNU_CC"; then echo $ac_n "checking for +Olit support""... $ac_c" 1>&6 -echo "configure:4948: checking for +Olit support" >&5 +echo "configure:4932: checking for +Olit support" >&5 if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4978,7 +4962,7 @@ esac echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:4982: checking for pthread_create in -lpthreads" >&5 +echo "configure:4966: checking for pthread_create in -lpthreads" >&5 echo " #include void *foo(void *v) { return v; } @@ -5000,7 +4984,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:5004: checking for pthread_create in -lpthread" >&5 +echo "configure:4988: checking for pthread_create in -lpthread" >&5 echo " #include void *foo(void *v) { return v; } @@ -5022,7 +5006,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:5026: checking for pthread_create in -lc_r" >&5 +echo "configure:5010: checking for pthread_create in -lc_r" >&5 echo " #include void *foo(void *v) { return v; } @@ -5044,7 +5028,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 -echo "configure:5048: checking for pthread_create in -lc" >&5 +echo "configure:5032: checking for pthread_create in -lc" >&5 echo " #include void *foo(void *v) { return v; } @@ -5196,7 +5180,7 @@ if test -n "$USE_PTHREADS"; then rm -f conftest* ac_cv_have_dash_pthread=no echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6 -echo "configure:5200: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:5184: checking whether ${CC-cc} accepts -pthread" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then @@ -5219,7 +5203,7 @@ echo "configure:5200: checking whether ${CC-cc} accepts -pthread" >&5 ac_cv_have_dash_pthreads=no if test "$ac_cv_have_dash_pthread" = "no"; then echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6 -echo "configure:5223: checking whether ${CC-cc} accepts -pthreads" >&5 +echo "configure:5207: checking whether ${CC-cc} accepts -pthreads" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then diff --git a/nsprpub/configure.in b/nsprpub/configure.in index a6a1dfc9eea4..d9a17a2c8257 100644 --- a/nsprpub/configure.in +++ b/nsprpub/configure.in @@ -1788,8 +1788,6 @@ mips-sony-newsos*) *-os2*) AC_DEFINE(XP_OS2) AC_DEFINE(XP_PC) - AC_DEFINE(BSD_SELECT) - AC_DEFINE(_PR_GLOBAL_THREADS_ONLY) LIB_SUFFIX=lib DLL_SUFFIX=dll RC=rc.exe @@ -1803,7 +1801,6 @@ mips-sony-newsos*) if test -n "$GNU_CC"; then AC_DEFINE(XP_OS2_EMX) AC_DEFINE(OS2) - AC_DEFINE(TCPV40HDRS) AR=emxomfar AR_FLAGS='r $@' CFLAGS="$CFLAGS -Wall -Zomf" @@ -1827,7 +1824,6 @@ mips-sony-newsos*) elif test "$VACPP" = "yes"; then AC_DEFINE(XP_OS2_VACPP) AC_DEFINE(OS2,4) - AC_DEFINE(TCPV40HDRS) AC_DEFINE(_X86_) OBJ_SUFFIX=obj AS=alp diff --git a/nsprpub/pr/include/md/_os2.h b/nsprpub/pr/include/md/_os2.h index 43395e069271..77b0709ca9d6 100644 --- a/nsprpub/pr/include/md/_os2.h +++ b/nsprpub/pr/include/md/_os2.h @@ -84,7 +84,9 @@ APIRET _Optlink SemReleasex86(PRAMSEM, ULONG); #define _PR_SI_ARCHITECTURE "x86" /* XXXMB hardcode for now */ #define HAVE_DLL +#define _PR_GLOBAL_THREADS_ONLY #undef HAVE_THREAD_AFFINITY +#define _PR_HAVE_THREADSAFE_GETHOST #define _PR_HAVE_ATOMIC_OPS #define HANDLE unsigned long @@ -240,6 +242,9 @@ extern PRInt32 _MD_CloseFile(PRInt32 osfd); /* --- Socket IO stuff --- */ +#define TCPV40HDRS +#define BSD_SELECT + /* The ones that don't map directly may need to be re-visited... */ #ifdef XP_OS2_VACPP #define EPIPE EBADF @@ -301,7 +306,6 @@ extern PRInt32 _MD_CloseSocket(PRInt32 osfd); #define _MD_INIT_IO (_PR_MD_INIT_IO) #define _MD_PR_POLL (_PR_MD_PR_POLL) -/* win95 doesn't have async IO */ #define _MD_SOCKET (_PR_MD_SOCKET) extern PRInt32 _MD_SocketAvailable(PRFileDesc *fd); #define _MD_SOCKETAVAILABLE _MD_SocketAvailable