boehm-gc: revert all CACAO-specific modifications; this is now an exact copy of the...
[cacao.git] / src / mm / boehm-gc / include / gc_config_macros.h
1 /*
2  * This should never be included directly.  It is included only from gc.h.
3  * We separate it only to make gc.h more suitable as documentation.
4  * 
5  * Some tests for old macros.  These violate our namespace rules and will
6  * disappear shortly.  Use the GC_ names.
7  */
8 #if defined(SOLARIS_THREADS) || defined(_SOLARIS_THREADS) \
9     || defined(_SOLARIS_PTHREADS) || defined(GC_SOLARIS_PTHREADS)
10   /* We no longer support old style Solaris threads.            */
11   /* GC_SOLARIS_THREADS now means pthreads.                     */
12 # ifndef GC_SOLARIS_THREADS
13 #   define GC_SOLARIS_THREADS
14 # endif
15 #endif
16 #if defined(IRIX_THREADS)
17 # define GC_IRIX_THREADS
18 #endif
19 #if defined(DGUX_THREADS)
20 # if !defined(GC_DGUX386_THREADS)
21 #  define GC_DGUX386_THREADS
22 # endif
23 #endif
24 #if defined(AIX_THREADS)
25 # define GC_AIX_THREADS
26 #endif
27 #if defined(HPUX_THREADS)
28 # define GC_HPUX_THREADS
29 #endif
30 #if defined(OSF1_THREADS)
31 # define GC_OSF1_THREADS
32 #endif
33 #if defined(LINUX_THREADS)
34 # define GC_LINUX_THREADS
35 #endif
36 #if defined(WIN32_THREADS)
37 # define GC_WIN32_THREADS
38 #endif
39 #if defined(USE_LD_WRAP)
40 # define GC_USE_LD_WRAP
41 #endif
42
43 #if !defined(_PTHREADS) && defined(GC_NETBSD_THREADS)
44 # define _PTHREADS
45 #endif
46
47 #if defined(GC_DGUX386_THREADS) && !defined(_POSIX4A_DRAFT10_SOURCE)
48 # define _POSIX4A_DRAFT10_SOURCE 1
49 #endif
50
51 # if defined(GC_SOLARIS_THREADS) || defined(GC_FREEBSD_THREADS) || \
52         defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) || \
53         defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || \
54         defined(GC_DGUX386_THREADS) || defined(GC_DARWIN_THREADS) || \
55         defined(GC_AIX_THREADS) || defined(GC_NETBSD_THREADS) || \
56         (defined(GC_WIN32_THREADS) && defined(__CYGWIN32__)) || \
57         defined(GC_GNU_THREADS)
58 #   define GC_PTHREADS
59 # endif
60
61 #if defined(GC_WIN32_PTHREADS)
62 #   define GC_WIN32_THREADS
63 #   define GC_PTHREADS
64 #endif
65
66 #if defined(GC_THREADS) && !defined(GC_PTHREADS)
67 # if defined(__linux__)
68 #   define GC_LINUX_THREADS
69 #   define GC_PTHREADS
70 # endif
71 # if !defined(__linux__) && (defined(_PA_RISC1_1) || defined(_PA_RISC2_0) \
72                          || defined(hppa) || defined(__HPPA)) \
73                          || (defined(__ia64) && defined(_HPUX_SOURCE))
74 #   define GC_HPUX_THREADS
75 #   define GC_PTHREADS
76 # endif
77 # if !defined(__linux__) && (defined(__alpha) || defined(__alpha__))
78 #   define GC_OSF1_THREADS
79 #   define GC_PTHREADS
80 # endif
81 # if defined(__mips) && !defined(__linux__)
82 #   define GC_IRIX_THREADS
83 #   define GC_PTHREADS
84 # endif
85 # if defined(__sparc) && !defined(__linux__) \
86      || defined(sun) && (defined(i386) || defined(__i386__) \
87                         || defined(__amd64__))
88 #   define GC_SOLARIS_THREADS
89 #   define GC_PTHREADS
90 # endif
91 # if defined(__APPLE__) && defined(__MACH__)
92 #   define GC_DARWIN_THREADS
93 #   define GC_PTHREADS
94 # endif
95 # if !defined(GC_PTHREADS) && (defined(__FreeBSD__) || defined(__DragonFly__))
96 #   define GC_FREEBSD_THREADS
97 #   define GC_PTHREADS
98 # endif
99 # if !defined(GC_PTHREADS) && defined(__NetBSD__)
100 #   define GC_NETBSD_THREADS
101 #   define GC_PTHREADS
102 # endif
103 # if defined(DGUX) && (defined(i386) || defined(__i386__))
104 #   define GC_DGUX386_THREADS
105 #   define GC_PTHREADS
106 # endif
107 # if defined(_AIX)
108 #   define GC_AIX_THREADS
109 #   define GC_PTHREADS
110 # endif
111 #endif /* GC_THREADS */
112
113 #if !defined(_REENTRANT) && (defined(GC_SOLARIS_THREADS) \
114                              || defined(GC_HPUX_THREADS) \
115                              || defined(GC_AIX_THREADS) \
116                              || defined(GC_LINUX_THREADS) \
117                              || defined(GC_NETBSD_THREADS) \
118                              || defined(GC_GNU_THREADS))
119 # define _REENTRANT
120         /* Better late than never.  This fails if system headers that   */
121         /* depend on this were previously included.                     */
122 #endif
123
124 #if defined(GC_THREADS) && !defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS) \
125     && (defined(_WIN32) || defined(_MSC_VER) || defined(__CYGWIN__) \
126      || defined(__MINGW32__) || defined(__BORLANDC__) \
127      || defined(_WIN32_WCE))
128 # define GC_WIN32_THREADS
129 # if defined(__CYGWIN__)
130 #   define GC_PTHREADS
131 # endif
132 #endif
133
134 # define __GC
135 # ifndef _WIN32_WCE
136 #   include <stddef.h>
137 #   if defined(__MINGW32__)
138 #     include <stdint.h>
139       /* We mention uintptr_t.                                      */
140       /* Perhaps this should be included in pure msft environments  */
141       /* as well?                                                   */
142 #   endif
143 # else /* ! _WIN32_WCE */
144 /* Yet more kludges for WinCE */
145 #   include <stdlib.h>          /* size_t is defined here */
146     typedef long ptrdiff_t;     /* ptrdiff_t is not defined */
147 # endif
148
149 #if defined(_DLL) && !defined(GC_NOT_DLL) && !defined(GC_DLL)
150 # define GC_DLL
151 #endif
152
153 #if defined(__MINGW32__) && defined(GC_DLL)
154 # ifdef GC_BUILD
155 #   define GC_API __declspec(dllexport)
156 # else
157 #   define GC_API __declspec(dllimport)
158 # endif
159 #endif
160
161 #if (defined(__DMC__) || defined(_MSC_VER) || defined(__BORLANDC__)) \
162     && defined(GC_DLL)
163 # ifdef GC_BUILD
164 #   define GC_API extern __declspec(dllexport)
165 # else
166 #   define GC_API __declspec(dllimport)
167 # endif
168 #endif
169
170 #if defined(__WATCOMC__) && defined(GC_DLL)
171 # ifdef GC_BUILD
172 #   define GC_API extern __declspec(dllexport)
173 # else
174 #   define GC_API extern __declspec(dllimport)
175 # endif
176 #endif
177
178 #ifndef GC_API
179 # define GC_API extern
180 #endif
181
182 #ifndef GC_CALL
183 # define GC_CALL
184 #endif
185
186 #ifndef GC_CALLBACK
187 # define GC_CALLBACK GC_CALL
188 #endif