From: hboehm Date: Fri, 21 Dec 2007 02:07:20 +0000 (+0000) Subject: 2007-12-20 Hans Boehm X-Git-Tag: gc7_1alpha2~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=229ac02581c039a6ca8d2c07d09605444a03eb0d;p=gc 2007-12-20 Hans Boehm * include/gc.h, doc/README.macros: Add GC_NO_THREAD_REDIRECTS, GC_NO_THREAD_DECLS, don't test explicitly for GC_SOLARIS_THREADS. --- diff --git a/ChangeLog b/ChangeLog index 5fe90fb6..8e4d6127 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-12-20 Hans Boehm + + * include/gc.h, doc/README.macros: Add GC_NO_THREAD_REDIRECTS, + GC_NO_THREAD_DECLS, don't test explicitly for GC_SOLARIS_THREADS. + 2007-12-20 Hans Boehm * alloc.c: Deal correctly with address wrapping for diff --git a/doc/README.macros b/doc/README.macros index 6a9a1fdc..1481c375 100644 --- a/doc/README.macros +++ b/doc/README.macros @@ -27,6 +27,16 @@ this. This is a work in progress) MACRO EXPLANATION ----- ----------- +GC_DEBUG Tested by gc.h. Causes all-upper-case macros to + expand to calls to debug versions of collector routines. + +GC_NO_THREAD_REDIRECTS Tested by gc.h. Prevents redirection of thread + creation routines etc. to GC_ versions. Requires the + programmer to explicitly handle thread registration. + +GC_NO_THREAD_DECLS Tested by gc.h. MS Windows only. Do not declare + Windows thread creation routines and do not include windows.h. + __DMC__ Always #define'd by the Digital Mars compiler. Expands to the compiler version number in hex, i.e. 0x810 is version 8.1b0 diff --git a/include/gc.h b/include/gc.h index 1fd1d1b2..8af8610c 100644 --- a/include/gc.h +++ b/include/gc.h @@ -975,8 +975,8 @@ GC_API void (*GC_is_visible_print_proc) (void * p); /* For pthread support, we generally need to intercept a number of */ /* thread library calls. We do that here by macro defining them. */ -#if !defined(GC_USE_LD_WRAP) && \ - (defined(GC_PTHREADS) || defined(GC_SOLARIS_THREADS)) +#if !defined(GC_USE_LD_WRAP) && !defined(GC_NO_THREAD_REDIRECTS) \ + && defined(GC_PTHREADS) # include "gc_pthread_redirects.h" #endif @@ -991,7 +991,6 @@ GC_API void (*GC_is_visible_print_proc) (void * p); void * GC_malloc_many(size_t lb); #define GC_NEXT(p) (*(void * *)(p)) /* Retrieve the next element */ /* in returned list. */ -extern void GC_thr_init(void); /* Needed for Solaris/X86 ?? */ #endif /* THREADS */ @@ -1013,6 +1012,7 @@ GC_register_has_static_roots_callback } /* Including windows.h in an extern "C" context no longer works. */ #endif +#ifndef GC_NO_THREAD_DECLS # include #ifdef __cplusplus @@ -1065,17 +1065,20 @@ GC_register_has_static_roots_callback # define WinMain GC_WinMain # endif # endif /* defined(_WIN32_WCE) */ +#endif /* !GC_NO_THREAD_DECLS */ /* * Use implicit thread registration via DllMain. */ GC_API void GC_use_DllMain(void); -# define CreateThread GC_CreateThread -# define ExitThread GC_ExitThread -# define _beginthreadex GC_beginthreadex -# define _endthreadex GC_endthreadex -# define _beginthread { > "Please use _beginthreadex instead of _beginthread" < } +# ifndef GC_NO_THREAD_REDIRECTS +# define CreateThread GC_CreateThread +# define ExitThread GC_ExitThread +# define _beginthreadex GC_beginthreadex +# define _endthreadex GC_endthreadex +# define _beginthread { > "Please use _beginthreadex instead of _beginthread" < } +# endif /* !GC_NO_THREAD_REDIRECTS */ #endif /* defined(GC_WIN32_THREADS) && !cygwin */