From 512e32d28948ed7f324e4b04d6be98f4b95d2d1c Mon Sep 17 00:00:00 2001 From: Anthony Green Date: Fri, 15 Mar 2002 18:01:38 +0000 Subject: [PATCH] Address mingw32 issues. From-SVN: r50816 --- boehm-gc/ChangeLog | 7 +++++++ boehm-gc/configure | 10 +++++++--- boehm-gc/configure.in | 1 + boehm-gc/misc.c | 7 ++++--- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index c132c031cf3..bf564944e84 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,10 @@ +2002-03-15 Anthony Green + + * misc.c (GC_init_inner): Initialize GC_write_cs before use. + * configure.in: Disable use of getenv for win32 targets (some of + which have broken implementations). + * configure: Rebuilt. + 2002-03-12 Adam Megacz * dyn_load.c: Renamed GC_win32s to GC_no_win32_dlls. diff --git a/boehm-gc/configure b/boehm-gc/configure index e2b4840c9d5..edfd4f116a9 100755 --- a/boehm-gc/configure +++ b/boehm-gc/configure @@ -2725,6 +2725,10 @@ EOF win32) cat >> confdefs.h <<\EOF #define GC_WIN32_THREADS 1 +EOF + + cat >> confdefs.h <<\EOF +#define NO_GETENV 1 EOF ;; @@ -2738,7 +2742,7 @@ esac echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2742: checking for dlopen in -ldl" >&5 +echo "configure:2746: 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 @@ -2746,7 +2750,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:2765: \"$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 diff --git a/boehm-gc/configure.in b/boehm-gc/configure.in index 155653dbf26..b3a785186c7 100644 --- a/boehm-gc/configure.in +++ b/boehm-gc/configure.in @@ -109,6 +109,7 @@ case "$THREADS" in ;; win32) AC_DEFINE(GC_WIN32_THREADS) + AC_DEFINE(NO_GETENV) ;; decosf1 | irix | mach | os2 | solaris | dce | vxworks) AC_MSG_ERROR(thread package $THREADS not yet supported) diff --git a/boehm-gc/misc.c b/boehm-gc/misc.c index a89f04407b4..50955f458cc 100644 --- a/boehm-gc/misc.c +++ b/boehm-gc/misc.c @@ -499,6 +499,10 @@ void GC_init_inner() # ifdef PRINTSTATS GC_print_stats = 1; # endif +# if defined(MSWIN32) || defined(MSWINCE) + InitializeCriticalSection(&GC_write_cs); +# endif + if (0 != GETENV("GC_PRINT_STATS")) { GC_print_stats = 1; } @@ -536,9 +540,6 @@ void GC_init_inner() if (ALIGNMENT > GC_DS_TAGS && EXTRA_BYTES != 0) { GC_obj_kinds[NORMAL].ok_descriptor = ((word)(-ALIGNMENT) | GC_DS_LENGTH); } -# if defined(MSWIN32) || defined(MSWINCE) - InitializeCriticalSection(&GC_write_cs); -# endif GC_setpagesize(); GC_exclude_static_roots(beginGC_arrays, endGC_arrays); GC_exclude_static_roots(beginGC_obj_kinds, endGC_obj_kinds);