+2007-12-20 Hans Boehm <Hans.Boehm@hp.com>
+
+ * 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 <Hans.Boehm@hp.com>
* alloc.c: Deal correctly with address wrapping for
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
/* 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
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 */
} /* Including windows.h in an extern "C" context no longer works. */
#endif
+#ifndef GC_NO_THREAD_DECLS
# include <windows.h>
#ifdef __cplusplus
# 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 */