(code refactoring)
* gc_cpp.cc (GC_DONT_INCL_WINDOWS_H): Define macro before include gc.h.
* tests/test_cpp.cc (GC_DONT_INCL_WINDOWS_H): Likewise.
* include/gc.h [GC_WIN32_THREADS && (!GC_PTHREADS || GC_BUILD
|| GC_WINDOWS_H_INCLUDED) && (!GC_NO_THREAD_DECLS || GC_BUILD)]:
If GC_DONT_INCL_WINDOWS_H then do not include process.h, windows.h,
and do not declare GC_CreateThread, GC_ExitThread, GC_DllMain,
GC_beginthreadex, GC_endthreadex.
# define GC_BUILD
#endif
+#define GC_DONT_INCL_WINDOWS_H
#include "gc.h"
#include <new> // for bad_alloc, precedes include of gc_cpp.h
/* Note: for Cygwin and pthreads-win32, this is skipped */
/* unless windows.h is included before gc.h. */
-# if !defined(GC_NO_THREAD_DECLS) || defined(GC_BUILD)
+# if (!defined(GC_NO_THREAD_DECLS) || defined(GC_BUILD)) \
+ && !defined(GC_DONT_INCL_WINDOWS_H)
# ifdef __cplusplus
} /* Including windows.h in an extern "C" context no longer works. */
#undef GC_BUILD
+#define GC_DONT_INCL_WINDOWS_H
#include "gc_cpp.h"
#include <stdio.h>