Commit aa44273b by Hans Boehm Committed by Hans Boehm

configure.in: Remove NO_GETENV definition for win32.

	* configure.in: Remove NO_GETENV definition for win32.
	* mach_dep.c (GC_generic_push_regs): Prevent tail call optimization.
	* misc.c (GC_init_inner): Call GC_thr_init for win32.
	  (GC_set_warn_proc): Add assertion.
	* win32_threads.c: Import 6.3alpha2 version.
	* include/private/gc_priv.h: Add support for EMPTY_GETENV_RESULTS.

From-SVN: r72074
parent f451eeef
2003-10-03 Hans Boehm <Hans.Boehm@hp.com>
* configure.in: Remove NO_GETENV definition for win32.
* mach_dep.c (GC_generic_push_regs): Prevent tail call optimization.
* misc.c (GC_init_inner): Call GC_thr_init for win32.
(GC_set_warn_proc): Add assertion.
* win32_threads.c: Import 6.3alpha2 version.
* include/private/gc_priv.h: Add support for EMPTY_GETENV_RESULTS.
2003-09-29 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> 2003-09-29 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* configure.in: Remove wildcard from Solaris 8-9/Intel and Solaris * configure.in: Remove wildcard from Solaris 8-9/Intel and Solaris
......
...@@ -137,8 +137,8 @@ case "$THREADS" in ...@@ -137,8 +137,8 @@ case "$THREADS" in
;; ;;
win32) win32)
AC_DEFINE(GC_WIN32_THREADS) AC_DEFINE(GC_WIN32_THREADS)
dnl Wine getenv may not return NULL for missing entry dnl Old wine getenv may not return NULL for missing entry.
AC_DEFINE(NO_GETENV) dnl Define EMPTY_GETENV_RESULTS here to work around the bug.
;; ;;
dgux386) dgux386)
THREADS=dgux386 THREADS=dgux386
......
...@@ -448,7 +448,19 @@ extern GC_warn_proc GC_current_warn_proc; ...@@ -448,7 +448,19 @@ extern GC_warn_proc GC_current_warn_proc;
/* Get environment entry */ /* Get environment entry */
#if !defined(NO_GETENV) #if !defined(NO_GETENV)
# define GETENV(name) getenv(name) # if defined(EMPTY_GETENV_RESULTS)
/* Workaround for a reputed Wine bug. */
static inline char * fixed_getenv(const char *name)
{
char * tmp = getenv(name);
if (tmp == 0 || strlen(tmp) == 0)
return 0;
return tmp;
}
# define GETENV(name) fixed_getenv(name)
# else
# define GETENV(name) getenv(name)
# endif
#else #else
# define GETENV(name) 0 # define GETENV(name) 0
#endif #endif
......
...@@ -405,6 +405,8 @@ void GC_generic_push_regs(cold_gc_frame) ...@@ -405,6 +405,8 @@ void GC_generic_push_regs(cold_gc_frame)
ptr_t cold_gc_frame; ptr_t cold_gc_frame;
{ {
{ {
word dummy;
# ifdef HAVE_BUILTIN_UNWIND_INIT # ifdef HAVE_BUILTIN_UNWIND_INIT
/* This was suggested by Richard Henderson as the way to */ /* This was suggested by Richard Henderson as the way to */
/* force callee-save registers and register windows onto */ /* force callee-save registers and register windows onto */
...@@ -448,6 +450,10 @@ ptr_t cold_gc_frame; ...@@ -448,6 +450,10 @@ ptr_t cold_gc_frame;
} }
# endif # endif
GC_push_current_stack(cold_gc_frame); GC_push_current_stack(cold_gc_frame);
/* Strongly discourage the compiler from treating the above */
/* as a tail-call, since that would pop the register */
/* contents before we get a chance to look at them. */
GC_noop1((word)(&dummy));
} }
} }
#endif /* USE_GENERIC_PUSH_REGS */ #endif /* USE_GENERIC_PUSH_REGS */
......
...@@ -638,7 +638,8 @@ void GC_init_inner() ...@@ -638,7 +638,8 @@ void GC_init_inner()
# if (defined(NETBSD) || defined(OPENBSD)) && defined(__ELF__) # if (defined(NETBSD) || defined(OPENBSD)) && defined(__ELF__)
GC_init_netbsd_elf(); GC_init_netbsd_elf();
# endif # endif
# if defined(GC_PTHREADS) || defined(GC_SOLARIS_THREADS) # if defined(GC_PTHREADS) || defined(GC_SOLARIS_THREADS) \
|| defined(GC_WIN32_THREADS)
GC_thr_init(); GC_thr_init();
# endif # endif
# ifdef GC_SOLARIS_THREADS # ifdef GC_SOLARIS_THREADS
...@@ -1002,6 +1003,9 @@ GC_warn_proc GC_current_warn_proc = GC_default_warn_proc; ...@@ -1002,6 +1003,9 @@ GC_warn_proc GC_current_warn_proc = GC_default_warn_proc;
{ {
GC_warn_proc result; GC_warn_proc result;
# ifdef GC_WIN32_THREADS
GC_ASSERT(GC_is_initialized);
# endif
LOCK(); LOCK();
result = GC_current_warn_proc; result = GC_current_warn_proc;
GC_current_warn_proc = p; GC_current_warn_proc = p;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment