1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
|
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
/***********************************************************************
// preprocessor
************************************************************************/
/* workaround for preprocessor bugs in some compilers */
#if 0
#define ACC_0xffffL 0xfffful
#define ACC_0xffffffffL 0xfffffffful
#else
#define ACC_0xffffL 65535ul
#define ACC_0xffffffffL 4294967295ul
#endif
/* some things we cannot work around */
#if (ACC_0xffffL == ACC_0xffffffffL)
# error "your preprocessor is broken 1"
#endif
#if (16ul * 16384ul != 262144ul)
# error "your preprocessor is broken 2"
#endif
#if 0
#if (32767 >= 4294967295ul)
# error "your preprocessor is broken 3"
#endif
#if (65535u >= 4294967295ul)
# error "your preprocessor is broken 4"
#endif
#endif
/***********************************************************************
// try to detect specific compilers
************************************************************************/
#if (UINT_MAX == ACC_0xffffL)
#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__)
# if !defined(MSDOS)
# define MSDOS 1
# endif
# if !defined(_MSDOS)
# define _MSDOS 1
# endif
#elif defined(__VERSION) && defined(MB_LEN_MAX)
# if (__VERSION == 520) && (MB_LEN_MAX == 1)
# if !defined(__AZTEC_C__)
# define __AZTEC_C__ __VERSION
# endif
# if !defined(__DOS__)
# define __DOS__ 1
# endif
# endif
#endif
#endif
/***********************************************************************
// fix incorrect and missing stuff
************************************************************************/
/* Microsoft C does not correctly define ptrdiff_t for
* the 16-bit huge memory model.
*/
#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == ACC_0xffffL)
# define ptrdiff_t long
# define _PTRDIFF_T_DEFINED
#endif
/* Fix old compiler versions. */
#if (UINT_MAX == ACC_0xffffL)
# undef __ACC_RENAME_A
# undef __ACC_RENAME_B
# if defined(__AZTEC_C__) && defined(__DOS__)
# define __ACC_RENAME_A 1
# elif defined(_MSC_VER) && defined(MSDOS)
# if (_MSC_VER < 600)
# define __ACC_RENAME_A 1
# elif (_MSC_VER < 700)
# define __ACC_RENAME_B 1
# endif
# elif defined(__TSC__) && defined(__OS2__)
# define __ACC_RENAME_A 1
# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410)
# define __ACC_RENAME_A 1
# elif defined(__PACIFIC__) && defined(DOS)
# if !defined(__far)
# define __far far
# endif
# if !defined(__near)
# define __near near
# endif
# endif
# if defined(__ACC_RENAME_A)
# if !defined(__cdecl)
# define __cdecl cdecl
# endif
# if !defined(__far)
# define __far far
# endif
# if !defined(__huge)
# define __huge huge
# endif
# if !defined(__near)
# define __near near
# endif
# if !defined(__pascal)
# define __pascal pascal
# endif
# if !defined(__huge)
# define __huge huge
# endif
# elif defined(__ACC_RENAME_B)
# if !defined(__cdecl)
# define __cdecl _cdecl
# endif
# if !defined(__far)
# define __far _far
# endif
# if !defined(__huge)
# define __huge _huge
# endif
# if !defined(__near)
# define __near _near
# endif
# if !defined(__pascal)
# define __pascal _pascal
# endif
# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
# if !defined(__cdecl)
# define __cdecl cdecl
# endif
# if !defined(__pascal)
# define __pascal pascal
# endif
# endif
# undef __ACC_RENAME_A
# undef __ACC_RENAME_B
#endif
#if (UINT_MAX == ACC_0xffffL)
#if defined(__AZTEC_C__) && defined(__DOS__)
# define ACC_BROKEN_CDECL_ALT_SYNTAX 1
#elif defined(_MSC_VER) && defined(MSDOS)
# if (_MSC_VER < 600)
# define ACC_BROKEN_INTEGRAL_CONSTANTS 1
# endif
# if (_MSC_VER < 700)
# define ACC_BROKEN_INTEGRAL_PROMOTION 1
# define ACC_BROKEN_SIZEOF 1
# endif
#elif defined(__PACIFIC__) && defined(DOS)
# define ACC_BROKEN_INTEGRAL_CONSTANTS 1
#elif defined(__TURBOC__) && defined(__MSDOS__)
# if (__TURBOC__ < 0x0150)
# define ACC_BROKEN_CDECL_ALT_SYNTAX 1
# define ACC_BROKEN_INTEGRAL_CONSTANTS 1
# define ACC_BROKEN_INTEGRAL_PROMOTION 1
# endif
# if (__TURBOC__ < 0x0200)
# define ACC_BROKEN_SIZEOF 1
# endif
# if (__TURBOC__ < 0x0400) && defined(__cplusplus)
# define ACC_BROKEN_CDECL_ALT_SYNTAX 1
# endif
#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
# define ACC_BROKEN_CDECL_ALT_SYNTAX 1
# define ACC_BROKEN_SIZEOF 1
#endif
#endif
#if defined(__WATCOMC__) && (__WATCOMC__ < 900)
# define ACC_BROKEN_INTEGRAL_CONSTANTS 1
#endif
/***********************************************************************
// ANSI C preprocessor macros (cpp)
************************************************************************/
#define ACC_CPP_STRINGIZE(x) #x
#define ACC_CPP_MACRO_EXPAND(x) ACC_CPP_STRINGIZE(x)
/* concatenate */
#define ACC_CPP_CONCAT2(a,b) a ## b
#define ACC_CPP_CONCAT3(a,b,c) a ## b ## c
#define ACC_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d
#define ACC_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
/* expand and concatenate (by using one level of indirection) */
#define ACC_CPP_ECONCAT2(a,b) ACC_CPP_CONCAT2(a,b)
#define ACC_CPP_ECONCAT3(a,b,c) ACC_CPP_CONCAT3(a,b,c)
#define ACC_CPP_ECONCAT4(a,b,c,d) ACC_CPP_CONCAT4(a,b,c,d)
#define ACC_CPP_ECONCAT5(a,b,c,d,e) ACC_CPP_CONCAT5(a,b,c,d,e)
/***********************************************************************
// stdc macros
************************************************************************/
#if defined(__cplusplus)
# undef __STDC_CONSTANT_MACROS
# undef __STDC_LIMIT_MACROS
# define __STDC_CONSTANT_MACROS 1
# define __STDC_LIMIT_MACROS 1
#endif
/***********************************************************************
// misc macros
************************************************************************/
#if defined(__cplusplus)
# define ACC_EXTERN_C extern "C"
#else
# define ACC_EXTERN_C extern
#endif
/*
vi:ts=4:et
*/
|