diff options
| author | Nick Barnes | 2001-10-31 14:40:56 +0000 |
|---|---|---|
| committer | Nick Barnes | 2001-10-31 14:40:56 +0000 |
| commit | 7acfca905d76140f4cc0b09c9a12de237de364cd (patch) | |
| tree | 3ed8babfa3a73d30f29e08ca5d5adcda4ca4e826 /mps/code/mpstd.h | |
| parent | b7ce4893f9902d57cd67ac9a92fa6c3d5a8fc833 (diff) | |
| download | emacs-7acfca905d76140f4cc0b09c9a12de237de364cd.tar.gz emacs-7acfca905d76140f4cc0b09c9a12de237de364cd.zip | |
Branch imports for masters.
Copied from Perforce
Change: 23678
ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code/mpstd.h')
| -rw-r--r-- | mps/code/mpstd.h | 299 |
1 files changed, 299 insertions, 0 deletions
diff --git a/mps/code/mpstd.h b/mps/code/mpstd.h new file mode 100644 index 00000000000..2365ceb1a3f --- /dev/null +++ b/mps/code/mpstd.h | |||
| @@ -0,0 +1,299 @@ | |||
| 1 | /* impl.h.mpstd: HARLEQUIN MEMORY POOL SYSTEM TARGET DETECTION | ||
| 2 | * | ||
| 3 | * $HopeName: MMsrc!mpstd.h(trunk.27) $ | ||
| 4 | * Copyright (C) 2000 Harlequin Limited. All rights reserved. | ||
| 5 | * | ||
| 6 | * Detect the target platform using predefined preprocessor symbols | ||
| 7 | * defined by the build environment. The symbols are derived from the | ||
| 8 | * documentation, or, in the case of GCC, from the compiler itself. | ||
| 9 | * References to the documentation appear above each detection line. | ||
| 10 | * | ||
| 11 | * .macos.ppc.align: MacOS / PowerPC requires 8 bytes alignment (in | ||
| 12 | * general). See "Mac OS Runtime Architecture", table 4-2. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef mpstd_h | ||
| 16 | #define mpstd_h | ||
| 17 | |||
| 18 | |||
| 19 | /* Irix 5/6 man cc and man abi. We can't check for _ABIO32 (see | ||
| 20 | * os.i5), as we have to support Irix 5.2, which doesn't define it. We | ||
| 21 | * check the value of _MIPS_FPSET, as it is defined across all Irix 5 | ||
| 22 | * and 6 platforms, and on Irix 6 distinguishes O32 from the other two | ||
| 23 | * ABIs. When we support the other ABIs, we need a new OS name for | ||
| 24 | * them. Alignment from testing. | ||
| 25 | */ | ||
| 26 | |||
| 27 | #if defined(__sgi) && defined(__unix) && defined(__mips) \ | ||
| 28 | && defined(_SYSTYPE_SVR4) && (_MIPS_FPSET == 16) | ||
| 29 | #define MPS_PF_I5M2CC | ||
| 30 | #define MPS_PF_STRING "i5m2cc" | ||
| 31 | #define MPS_OS_I5 | ||
| 32 | #define MPS_ARCH_M2 | ||
| 33 | #define MPS_BUILD_CC | ||
| 34 | #define MPS_T_WORD unsigned long | ||
| 35 | #define MPS_WORD_WIDTH 32 | ||
| 36 | #define MPS_WORD_SHIFT 5 | ||
| 37 | #define MPS_PF_ALIGN 8 | ||
| 38 | |||
| 39 | /* See above. Alignment from testing. */ | ||
| 40 | |||
| 41 | #elif defined(__sgi) && defined(__unix) && defined(__mips) \ | ||
| 42 | && defined(_SYSTYPE_SVR4) && defined(_ABIN32) | ||
| 43 | #define MPS_PF_IAM4CC | ||
| 44 | #define MPS_PF_STRING "iam4cc" | ||
| 45 | #define MPS_OS_IA | ||
| 46 | #define MPS_ARCH_M4 | ||
| 47 | #define MPS_BUILD_CC | ||
| 48 | #define MPS_T_WORD unsigned long | ||
| 49 | #define MPS_WORD_WIDTH 32 | ||
| 50 | #define MPS_WORD_SHIFT 5 | ||
| 51 | #define MPS_PF_ALIGN 8 | ||
| 52 | |||
| 53 | /* winnt.h from MS VC 2.0 */ | ||
| 54 | |||
| 55 | #elif defined(_MSC_VER) && defined(_WIN32) && defined(_M_ALPHA) | ||
| 56 | #define MPS_PF_W3ALMV | ||
| 57 | #define MPS_PF_STRING "w3almv" | ||
| 58 | #define MPS_OS_W3 | ||
| 59 | #define MPS_ARCH_AL | ||
| 60 | #define MPS_BUILD_MV | ||
| 61 | #define MPS_T_WORD unsigned long | ||
| 62 | #define MPS_WORD_WIDTH 32 | ||
| 63 | #define MPS_WORD_SHIFT 5 | ||
| 64 | #define MPS_PF_ALIGN 4 | ||
| 65 | |||
| 66 | /* winnt.h from MS VC 2.0 */ | ||
| 67 | |||
| 68 | #elif defined(_MSC_VER) && defined(_WIN32) && defined(_M_PPC) | ||
| 69 | #define MPS_PF_W3PPMV | ||
| 70 | #define MPS_PF_STRING "w3ppmv" | ||
| 71 | #define MPS_OS_W3 | ||
| 72 | #define MPS_ARCH_PP | ||
| 73 | #define MPS_BUILD_MV | ||
| 74 | #define MPS_T_WORD unsigned long | ||
| 75 | #define MPS_WORD_WIDTH 32 | ||
| 76 | #define MPS_WORD_SHIFT 5 | ||
| 77 | #define MPS_PF_ALIGN 4 | ||
| 78 | |||
| 79 | /* Visual C++ 2.0, Books Online, C/C++ Book, Preprocessor Reference, | ||
| 80 | * Chapter 1: The Preprocessor, Macros, Predefined Macros. | ||
| 81 | * Alignment of 4 would work, but the MS library uses 8 bytes for | ||
| 82 | * doubles and __int64, so we choose that. The actual granularity of | ||
| 83 | * VC malloc is 16! | ||
| 84 | */ | ||
| 85 | |||
| 86 | #elif defined(_MSC_VER) && defined(_WIN32) && defined(_M_IX86) | ||
| 87 | #define MPS_PF_W3I3MV | ||
| 88 | #define MPS_PF_STRING "w3i3mv" | ||
| 89 | #define MPS_OS_W3 | ||
| 90 | #define MPS_ARCH_I3 | ||
| 91 | #define MPS_BUILD_MV | ||
| 92 | #define MPS_T_WORD unsigned long | ||
| 93 | #define MPS_WORD_WIDTH 32 | ||
| 94 | #define MPS_WORD_SHIFT 5 | ||
| 95 | #define MPS_PF_ALIGN 8 | ||
| 96 | |||
| 97 | /* MW C/C++/ASM Lang Ref (CW9), pp. 184-186. Metrowerks does not document | ||
| 98 | * a way to determine the OS -- we assume MacOS 7. | ||
| 99 | */ | ||
| 100 | |||
| 101 | #elif defined(__MWERKS__) && __MC68K__ == 1 | ||
| 102 | #define MPS_PF_S760MW | ||
| 103 | #define MPS_PF_STRING "s760mw" | ||
| 104 | #define MPS_OS_S7 | ||
| 105 | #define MPS_ARCH_60 | ||
| 106 | #define MPS_BUILD_MW | ||
| 107 | #define MPS_T_WORD unsigned long | ||
| 108 | #define MPS_WORD_WIDTH 32 | ||
| 109 | #define MPS_WORD_SHIFT 5 | ||
| 110 | #define MPS_PF_ALIGN 1 | ||
| 111 | |||
| 112 | /* MW C/C++/ASM Lang Ref (CW9), pp. 184-186. Metrowerks does not document | ||
| 113 | * a way to determine the OS -- we assume MacOS 7. | ||
| 114 | */ | ||
| 115 | |||
| 116 | #elif defined(__MWERKS__) && __POWERPC__ == 1 | ||
| 117 | #define MPS_PF_S7PPMW | ||
| 118 | #define MPS_PF_STRING "s7ppmw" | ||
| 119 | #define MPS_OS_S7 | ||
| 120 | #define MPS_ARCH_PP | ||
| 121 | #define MPS_BUILD_MW | ||
| 122 | #define MPS_T_WORD unsigned long | ||
| 123 | #define MPS_WORD_WIDTH 32 | ||
| 124 | #define MPS_WORD_SHIFT 5 | ||
| 125 | #define MPS_PF_ALIGN 8 /* .macos.ppc.align */ | ||
| 126 | |||
| 127 | /* 1. MPW 3.0 C Ref, p. 43. | ||
| 128 | * 2. MPW SC/SCpp C/C++ Compiler for 68k Macintosh, p 3-60. | ||
| 129 | * These are the two MPW 68k compilers. They do not define anything | ||
| 130 | * which lets us determine the system version. | ||
| 131 | */ | ||
| 132 | |||
| 133 | #elif defined(m68k) && (defined (applec) || defined(__SC__)) | ||
| 134 | #define MPS_PF_S760AC | ||
| 135 | #define MPS_PF_STRING "s760ac" | ||
| 136 | #define MPS_OS_S7 | ||
| 137 | #define MPS_ARCH_60 | ||
| 138 | #define MPS_BUILD_AC | ||
| 139 | #define MPS_T_WORD unsigned long | ||
| 140 | #define MPS_WORD_WIDTH 32 | ||
| 141 | #define MPS_WORD_SHIFT 5 | ||
| 142 | #define MPS_PF_ALIGN 1 | ||
| 143 | |||
| 144 | /* 1. C++/C Compiler for Macintosh with PowerPC, p 3-36. | ||
| 145 | * 2. MPW MrC/MrCpp C/C++ Compiler for Power Macintosh, p 3-57. | ||
| 146 | * These are the two MPW PowerPC compilers. They do not define anything | ||
| 147 | * which lets us determine the system version. | ||
| 148 | */ | ||
| 149 | |||
| 150 | #elif defined(__PPCC__) || (defined(__MRC__) && defined(__POWERPC)) | ||
| 151 | #define MPS_PF_S7PPAC | ||
| 152 | #define MPS_PF_STRING "s7ppac" | ||
| 153 | #define MPS_OS_S7 | ||
| 154 | #define MPS_ARCH_PP | ||
| 155 | #define MPS_BUILD_AC | ||
| 156 | #define MPS_T_WORD unsigned long | ||
| 157 | #define MPS_WORD_WIDTH 32 | ||
| 158 | #define MPS_WORD_SHIFT 5 | ||
| 159 | #define MPS_PF_ALIGN 8 /* .macos.ppc.align */ | ||
| 160 | |||
| 161 | /* GCC 2.7.2.1, gcc -E -dM -traditional-cpp and <URL:http://developer.apple.c | ||
| 162 | * om/techpubs/macosx/System/Documentation/Developer/YellowBox/Reference/DevT | ||
| 163 | * ools/Preprocessor/Preprocessor.[ef].html> | ||
| 164 | */ | ||
| 165 | |||
| 166 | #elif defined(__APPLE__) && defined(__ppc__) && defined(__MACH__) && defined(__GNUC__) | ||
| 167 | #define MPS_PF_XCPPGC | ||
| 168 | #define MPS_PF_STRING "xcppgc" | ||
| 169 | #define MPS_OS_XC | ||
| 170 | #define MPS_ARCH_PP | ||
| 171 | #define MPS_BUILD_GC | ||
| 172 | #define MPS_T_WORD unsigned long | ||
| 173 | #define MPS_WORD_WIDTH 32 | ||
| 174 | #define MPS_WORD_SHIFT 5 | ||
| 175 | #define MPS_PF_ALIGN 8 /* .macos.ppc.align */ | ||
| 176 | |||
| 177 | /* GCC 2.5.8, gcc -E -dM, (__SVR4 indicates Solaris) */ | ||
| 178 | |||
| 179 | #elif defined(__sun__) && defined(__sparc__) && defined(__GNUC__) \ | ||
| 180 | && !defined(__svr4__) | ||
| 181 | #define MPS_PF_SUS8GC | ||
| 182 | #define MPS_PF_STRING "sus8gc" | ||
| 183 | #define MPS_OS_SU | ||
| 184 | #define MPS_ARCH_S8 | ||
| 185 | #define MPS_BUILD_GC | ||
| 186 | #define MPS_T_WORD unsigned long | ||
| 187 | #define MPS_WORD_WIDTH 32 | ||
| 188 | #define MPS_WORD_SHIFT 5 | ||
| 189 | #define MPS_PF_ALIGN 8 | ||
| 190 | |||
| 191 | /* LCC 3.4 (ish), man page */ | ||
| 192 | |||
| 193 | #elif defined(sun) && defined(sparc) && defined(__LCC__) \ | ||
| 194 | && !defined(__svr4__) | ||
| 195 | #define MPS_PF_SUS8LC | ||
| 196 | #define MPS_PF_STRING "sus8lc" | ||
| 197 | #define MPS_OS_SU | ||
| 198 | #define MPS_ARCH_S8 | ||
| 199 | #define MPS_BUILD_LC | ||
| 200 | #define MPS_T_WORD unsigned long | ||
| 201 | #define MPS_WORD_WIDTH 32 | ||
| 202 | #define MPS_WORD_SHIFT 5 | ||
| 203 | #define MPS_PF_ALIGN 8 | ||
| 204 | |||
| 205 | /* GCC 2.5.8, gcc -E -dM */ | ||
| 206 | |||
| 207 | #elif defined(__sun__) && defined(__sparc__) && defined(__GNUC__) \ | ||
| 208 | && defined(__svr4__) | ||
| 209 | #define MPS_PF_SOS8GC | ||
| 210 | #define MPS_PF_STRING "sos8gc" | ||
| 211 | #define MPS_OS_SO | ||
| 212 | #define MPS_ARCH_S8 | ||
| 213 | #define MPS_BUILD_GC | ||
| 214 | #define MPS_T_WORD unsigned long | ||
| 215 | #define MPS_WORD_WIDTH 32 | ||
| 216 | #define MPS_WORD_SHIFT 5 | ||
| 217 | #define MPS_PF_ALIGN 8 | ||
| 218 | |||
| 219 | /* SunPro C, man cc (confirmed by grep). Note that this doesn't | ||
| 220 | * actually nail down UltraSPARCs; there are no compiler predefined | ||
| 221 | * macros for that. | ||
| 222 | */ | ||
| 223 | |||
| 224 | #elif defined(__sun) && defined(__SUNPRO_C) && defined(__SVR4) \ | ||
| 225 | && defined(__sparc) | ||
| 226 | |||
| 227 | #define MPS_PF_SOS9SC | ||
| 228 | #define MPS_PF_STRING "sos9sc" | ||
| 229 | #define MPS_OS_SO | ||
| 230 | #define MPS_ARCH_S9 | ||
| 231 | #define MPS_BUILD_SC | ||
| 232 | #define MPS_T_WORD unsigned long | ||
| 233 | #define MPS_WORD_WIDTH 32 | ||
| 234 | #define MPS_WORD_SHIFT 5 | ||
| 235 | #define MPS_PF_ALIGN 8 | ||
| 236 | |||
| 237 | /* GCC 2.6.3, gcc -E -dM */ | ||
| 238 | |||
| 239 | #elif defined(__osf__) && defined(__alpha__) && defined(__GNUC__) | ||
| 240 | #define MPS_PF_O1ALGC | ||
| 241 | #define MPS_PF_STRING "o1algc" | ||
| 242 | #define MPS_OS_O1 | ||
| 243 | #define MPS_ARCH_AL | ||
| 244 | #define MPS_BUILD_GC | ||
| 245 | #define MPS_T_WORD unsigned long | ||
| 246 | #define MPS_T_SHORT unsigned | ||
| 247 | #define MPS_WORD_WIDTH 64 | ||
| 248 | #define MPS_WORD_SHIFT 6 | ||
| 249 | #define MPS_PF_ALIGN 8 | ||
| 250 | |||
| 251 | /* From the cc(1) man page */ | ||
| 252 | |||
| 253 | #elif defined(__osf__) && defined(__alpha) && defined(__DECC) | ||
| 254 | #define MPS_PF_O1ALCC | ||
| 255 | #define MPS_PF_STRING "o1alcc" | ||
| 256 | #define MPS_OS_O1 | ||
| 257 | #define MPS_ARCH_AL | ||
| 258 | #define MPS_BUILD_CC | ||
| 259 | #define MPS_T_WORD unsigned long | ||
| 260 | #define MPS_T_SHORT unsigned | ||
| 261 | #define MPS_WORD_WIDTH 64 | ||
| 262 | #define MPS_WORD_SHIFT 6 | ||
| 263 | #define MPS_PF_ALIGN 8 | ||
| 264 | |||
| 265 | /* GCC 2.6.3, gcc -E -dM | ||
| 266 | * The actual granularity of GNU malloc is 8, but field alignments are | ||
| 267 | * all 4. | ||
| 268 | */ | ||
| 269 | |||
| 270 | #elif defined(__linux__) && defined(__i386__) && defined(__GNUC__) | ||
| 271 | #define MPS_PF_LII4GC | ||
| 272 | #define MPS_PF_STRING "lii4gc" | ||
| 273 | #define MPS_OS_LI | ||
| 274 | #define MPS_ARCH_I4 | ||
| 275 | #define MPS_BUILD_GC | ||
| 276 | #define MPS_T_WORD unsigned long | ||
| 277 | #define MPS_WORD_WIDTH 32 | ||
| 278 | #define MPS_WORD_SHIFT 5 | ||
| 279 | #define MPS_PF_ALIGN 4 | ||
| 280 | |||
| 281 | /* GCC 2.7.2, gcc -E -dM */ | ||
| 282 | |||
| 283 | #elif defined(__linux__) && defined(__PPC__) && defined(__GNUC__) | ||
| 284 | #define MPS_PF_LIPPGC | ||
| 285 | #define MPS_PF_STRING "lippgc" | ||
| 286 | #define MPS_OS_LI | ||
| 287 | #define MPS_ARCH_PP | ||
| 288 | #define MPS_BUILD_GC | ||
| 289 | #define MPS_T_WORD unsigned long | ||
| 290 | #define MPS_WORD_WIDTH 32 | ||
| 291 | #define MPS_WORD_SHIFT 5 | ||
| 292 | #define MPS_PF_ALIGN 8 /* @@@@ not tested */ | ||
| 293 | |||
| 294 | #else | ||
| 295 | #error "Unable to detect target platform" | ||
| 296 | #endif | ||
| 297 | |||
| 298 | |||
| 299 | #endif /* mpstd_h */ | ||