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(_REENTRANT) && (defined(GC_SOLARIS_THREADS) \ 44 || defined(GC_HPUX_THREADS) \ 45 || defined(GC_AIX_THREADS) \ 46 || defined(GC_LINUX_THREADS) \ 47 || defined(GC_NETBSD_THREADS) \ 48 || defined(GC_GNU_THREADS)) 49 # define _REENTRANT 50 /* Better late than never. This fails if system headers that */ 51 /* depend on this were previously included. */ 52 #endif 53 54 #if !defined(_PTHREADS) && defined(GC_NETBSD_THREADS) 55 # define _PTHREADS 56 #endif 57 58 #if defined(GC_DGUX386_THREADS) && !defined(_POSIX4A_DRAFT10_SOURCE) 59 # define _POSIX4A_DRAFT10_SOURCE 1 60 #endif 61 62 # if defined(GC_SOLARIS_THREADS) || defined(GC_FREEBSD_THREADS) || \ 63 defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) || \ 64 defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || \ 65 defined(GC_DGUX386_THREADS) || defined(GC_DARWIN_THREADS) || \ 66 defined(GC_AIX_THREADS) || defined(GC_NETBSD_THREADS) || \ 67 (defined(GC_WIN32_THREADS) && defined(__CYGWIN32__)) || \ 68 defined(GC_GNU_THREADS) 69 # define GC_PTHREADS 70 # endif 71 72 #if defined(GC_WIN32_PTHREADS) 73 # define GC_WIN32_THREADS 74 # define GC_PTHREADS 75 #endif 76 77 #if defined(GC_THREADS) && !defined(GC_PTHREADS) 78 # if defined(__linux__) 79 # define GC_LINUX_THREADS 80 # define GC_PTHREADS 81 # endif 82 # if !defined(__linux__) && (defined(_PA_RISC1_1) || defined(_PA_RISC2_0) \ 83 || defined(hppa) || defined(__HPPA)) \ 84 || (defined(__ia64) && defined(_HPUX_SOURCE)) 85 # define GC_HPUX_THREADS 86 # define GC_PTHREADS 87 # endif 88 # if !defined(__linux__) && (defined(__alpha) || defined(__alpha__)) 89 # define GC_OSF1_THREADS 90 # define GC_PTHREADS 91 # endif 92 # if defined(__mips) && !defined(__linux__) 93 # define GC_IRIX_THREADS 94 # define GC_PTHREADS 95 # endif 96 # if defined(__sparc) && !defined(__linux__) \ 97 || defined(sun) && (defined(i386) || defined(__i386__)) 98 # define GC_SOLARIS_THREADS 99 # define GC_PTHREADS 100 # endif 101 # if defined(__APPLE__) && defined(__MACH__) 102 # define GC_DARWIN_THREADS 103 # define GC_PTHREADS 104 # endif 105 # if !defined(GC_PTHREADS) && (defined(__FreeBSD__) || defined(__DragonFly__)) 106 # define GC_FREEBSD_THREADS 107 # define GC_PTHREADS 108 # endif 109 # if !defined(GC_PTHREADS) && defined(__NetBSD__) 110 # define GC_NETBSD_THREADS 111 # define GC_PTHREADS 112 # endif 113 # if defined(DGUX) && (defined(i386) || defined(__i386__)) 114 # define GC_DGUX386_THREADS 115 # define GC_PTHREADS 116 # endif 117 # if defined(_AIX) 118 # define GC_AIX_THREADS 119 # define GC_PTHREADS 120 # endif 121 #endif /* GC_THREADS */ 122 123 #if defined(GC_THREADS) && !defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS) \ 124 && (defined(_WIN32) || defined(_MSC_VER) || defined(__CYGWIN__) \ 125 || defined(__MINGW32__) || defined(__BORLANDC__) \ 126 || defined(_WIN32_WCE)) 127 # define GC_WIN32_THREADS 128 # if defined(__CYGWIN__) 129 # define GC_PTHREADS 130 # endif 131 #endif 132 133 # define __GC 134 # ifndef _WIN32_WCE 135 # include <stddef.h> 136 # if defined(__MINGW32__) 137 # include <stdint.h> 138 /* We mention uintptr_t. */ 139 /* Perhaps this should be included in pure msft environments */ 140 /* as well? */ 141 # endif 142 # else /* ! _WIN32_WCE */ 143 /* Yet more kluges for WinCE */ 144 # include <stdlib.h> /* size_t is defined here */ 145 typedef long ptrdiff_t; /* ptrdiff_t is not defined */ 146 # endif 147 148 #if defined(_DLL) && !defined(GC_NOT_DLL) && !defined(GC_DLL) 149 # define GC_DLL 150 #endif 151 152 #if defined(__MINGW32__) && defined(GC_DLL) 153 # ifdef GC_BUILD 154 # define GC_API __declspec(dllexport) 155 # else 156 # define GC_API __declspec(dllimport) 157 # endif 158 #endif 159 160 #if (defined(__DMC__) || defined(_MSC_VER)) && defined(GC_DLL) 161 # ifdef GC_BUILD 162 # define GC_API extern __declspec(dllexport) 163 # else 164 # define GC_API __declspec(dllimport) 165 # endif 166 #endif 167 168 #if defined(__WATCOMC__) && defined(GC_DLL) 169 # ifdef GC_BUILD 170 # define GC_API extern __declspec(dllexport) 171 # else 172 # define GC_API extern __declspec(dllimport) 173 # endif 174 #endif 175 176 #ifndef GC_API 177 #define GC_API extern 178 #endif 179 180