Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 26 | pmbaty | 1 | /* ACC -- Automatic Compiler Configuration |
| 2 | |||
| 3 | Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer |
||
| 4 | All Rights Reserved. |
||
| 5 | |||
| 6 | This software is a copyrighted work licensed under the terms of |
||
| 7 | the GNU General Public License. Please consult the file "ACC_LICENSE" |
||
| 8 | for details. |
||
| 9 | |||
| 10 | Markus F.X.J. Oberhumer |
||
| 11 | <markus@oberhumer.com> |
||
| 12 | http://www.oberhumer.com/ |
||
| 13 | */ |
||
| 14 | |||
| 15 | |||
| 16 | /*********************************************************************** |
||
| 17 | // |
||
| 18 | ************************************************************************/ |
||
| 19 | |||
| 20 | #if (ACC_CC_GNUC >= 0x020800ul) /* 2.8.0 */ |
||
| 21 | # define __acc_gnuc_extension__ __extension__ |
||
| 22 | #else |
||
| 23 | # define __acc_gnuc_extension__ |
||
| 24 | #endif |
||
| 25 | |||
| 26 | #if (SIZEOF_LONG_LONG > 0) |
||
| 27 | __acc_gnuc_extension__ typedef long long acc_llong_t; |
||
| 28 | #endif |
||
| 29 | #if (SIZEOF_UNSIGNED_LONG_LONG > 0) |
||
| 30 | __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t; |
||
| 31 | #endif |
||
| 32 | |||
| 33 | #if (!(SIZEOF_SHORT > 0 && SIZEOF_INT > 0 && SIZEOF_LONG > 0)) |
||
| 34 | # error "missing defines for sizes" |
||
| 35 | #endif |
||
| 36 | #if (!(SIZEOF_PTRDIFF_T > 0 && SIZEOF_SIZE_T > 0 && SIZEOF_VOID_P > 0 && SIZEOF_CHAR_P > 0)) |
||
| 37 | # error "missing defines for sizes" |
||
| 38 | #endif |
||
| 39 | |||
| 40 | |||
| 41 | /*********************************************************************** |
||
| 42 | // some <stdint.h> types: |
||
| 43 | // required: least & fast: acc_int32l_t, acc_int32f_t |
||
| 44 | // optional: exact32 acc_int32e_t |
||
| 45 | // optional: least64 acc_int64l_t |
||
| 46 | ************************************************************************/ |
||
| 47 | |||
| 48 | /* acc_int32e_t is int32_t in <stdint.h> terminology */ |
||
| 49 | #if !defined(acc_int32e_t) |
||
| 50 | #if (SIZEOF_INT == 4) |
||
| 51 | # define acc_int32e_t int |
||
| 52 | # define acc_uint32e_t unsigned int |
||
| 53 | # define ACC_INT32E_C(c) c |
||
| 54 | # define ACC_UINT32E_C(c) c##U |
||
| 55 | #elif (SIZEOF_LONG == 4) |
||
| 56 | # define acc_int32e_t long int |
||
| 57 | # define acc_uint32e_t unsigned long int |
||
| 58 | # define ACC_INT32E_C(c) c##L |
||
| 59 | # define ACC_UINT32E_C(c) c##UL |
||
| 60 | #elif (SIZEOF_SHORT == 4) |
||
| 61 | # define acc_int32e_t short int |
||
| 62 | # define acc_uint32e_t unsigned short int |
||
| 63 | # define ACC_INT32E_C(c) c |
||
| 64 | # define ACC_UINT32E_C(c) c##U |
||
| 65 | #elif (SIZEOF_LONG_LONG == 4 && SIZEOF_UNSIGNED_LONG_LONG == 4) |
||
| 66 | # define acc_int32e_t acc_llong_t |
||
| 67 | # define acc_uint32e_t acc_ullong_t |
||
| 68 | # define ACC_INT32E_C(c) c##LL |
||
| 69 | # define ACC_UINT32E_C(c) c##ULL |
||
| 70 | #elif (SIZEOF___INT32 == 4 && SIZEOF_UNSIGNED___INT32 == 4) |
||
| 71 | # define acc_int32e_t __int32 |
||
| 72 | # define acc_uint32e_t unsigned __int32 |
||
| 73 | # if (SIZEOF_INT > 4) |
||
| 74 | # define ACC_INT32E_C(c) c |
||
| 75 | # define ACC_UINT32E_C(c) c##U |
||
| 76 | # elif (SIZEOF_LONG > 4) |
||
| 77 | # define ACC_INT32E_C(c) c##L |
||
| 78 | # define ACC_UINT32E_C(c) c##UL |
||
| 79 | # else |
||
| 80 | # define ACC_INT32E_C(c) c##i32 |
||
| 81 | # define ACC_UINT32E_C(c) c##ui32 |
||
| 82 | # endif |
||
| 83 | #else |
||
| 84 | /* no exact 32-bit integral type on this machine */ |
||
| 85 | #endif |
||
| 86 | #endif |
||
| 87 | #if defined(acc_int32e_t) |
||
| 88 | # define SIZEOF_ACC_INT32E_T 4 |
||
| 89 | #endif |
||
| 90 | |||
| 91 | |||
| 92 | /* acc_int32l_t is int_least32_t in <stdint.h> terminology */ |
||
| 93 | #if !defined(acc_int32l_t) |
||
| 94 | #if defined(acc_int32e_t) |
||
| 95 | # define acc_int32l_t acc_int32e_t |
||
| 96 | # define acc_uint32l_t acc_uint32e_t |
||
| 97 | # define ACC_INT32L_C(c) ACC_INT32E_C(c) |
||
| 98 | # define ACC_UINT32L_C(c) ACC_UINT32E_C(c) |
||
| 99 | # define SIZEOF_ACC_INT32L_T SIZEOF_ACC_INT32E_T |
||
| 100 | #elif (SIZEOF_INT > 4) |
||
| 101 | # define acc_int32l_t int |
||
| 102 | # define acc_uint32l_t unsigned int |
||
| 103 | # define ACC_INT32L_C(c) c |
||
| 104 | # define ACC_UINT32L_C(c) c##U |
||
| 105 | # define SIZEOF_ACC_INT32L_T SIZEOF_INT |
||
| 106 | #elif (SIZEOF_LONG > 4) |
||
| 107 | # define acc_int32l_t long int |
||
| 108 | # define acc_uint32l_t unsigned long int |
||
| 109 | # define ACC_INT32L_C(c) c##L |
||
| 110 | # define ACC_UINT32L_C(c) c##UL |
||
| 111 | # define SIZEOF_ACC_INT32L_T SIZEOF_LONG |
||
| 112 | #else |
||
| 113 | # error "acc_int32l_t" |
||
| 114 | #endif |
||
| 115 | #endif |
||
| 116 | |||
| 117 | |||
| 118 | /* acc_int32f_t is int_fast32_t in <stdint.h> terminology */ |
||
| 119 | #if !defined(acc_int32f_t) |
||
| 120 | #if (SIZEOF_INT >= 4) |
||
| 121 | # define acc_int32f_t int |
||
| 122 | # define acc_uint32f_t unsigned int |
||
| 123 | # define ACC_INT32F_C(c) c |
||
| 124 | # define ACC_UINT32F_C(c) c##U |
||
| 125 | # define SIZEOF_ACC_INT32F_T SIZEOF_INT |
||
| 126 | #elif (SIZEOF_LONG >= 4) |
||
| 127 | # define acc_int32f_t long int |
||
| 128 | # define acc_uint32f_t unsigned long int |
||
| 129 | # define ACC_INT32F_C(c) c##L |
||
| 130 | # define ACC_UINT32F_C(c) c##UL |
||
| 131 | # define SIZEOF_ACC_INT32F_T SIZEOF_LONG |
||
| 132 | #elif defined(acc_int32e_t) |
||
| 133 | # define acc_int32f_t acc_int32e_t |
||
| 134 | # define acc_uint32f_t acc_uint32e_t |
||
| 135 | # define ACC_INT32F_C(c) ACC_INT32E_C(c) |
||
| 136 | # define ACC_UINT32F_C(c) ACC_UINT32E_C(c) |
||
| 137 | # define SIZEOF_ACC_INT32F_T SIZEOF_ACC_INT32E_T |
||
| 138 | #else |
||
| 139 | # error "acc_int32f_t" |
||
| 140 | #endif |
||
| 141 | #endif |
||
| 142 | |||
| 143 | |||
| 144 | /* acc_int64l_t is int_least64_t in <stdint.h> terminology */ |
||
| 145 | #if !defined(acc_int64l_t) |
||
| 146 | #if (SIZEOF___INT64 >= 8 && SIZEOF_UNSIGNED___INT64 >= 8) |
||
| 147 | # if (ACC_CC_BORLANDC) && !defined(ACC_CONFIG_PREFER___INT64) |
||
| 148 | # define ACC_CONFIG_PREFER___INT64 1 |
||
| 149 | # endif |
||
| 150 | #endif |
||
| 151 | #if (SIZEOF_INT >= 8) |
||
| 152 | # define acc_int64l_t int |
||
| 153 | # define acc_uint64l_t unsigned int |
||
| 154 | # define ACC_INT64L_C(c) c |
||
| 155 | # define ACC_UINT64L_C(c) c##U |
||
| 156 | # define SIZEOF_ACC_INT64L_T SIZEOF_INT |
||
| 157 | #elif (SIZEOF_LONG >= 8) |
||
| 158 | # define acc_int64l_t long int |
||
| 159 | # define acc_uint64l_t unsigned long int |
||
| 160 | # define ACC_INT64L_C(c) c##L |
||
| 161 | # define ACC_UINT64L_C(c) c##UL |
||
| 162 | # define SIZEOF_ACC_INT64L_T SIZEOF_LONG |
||
| 163 | #elif (SIZEOF_LONG_LONG >= 8 && SIZEOF_UNSIGNED_LONG_LONG >= 8) && !defined(ACC_CONFIG_PREFER___INT64) |
||
| 164 | # define acc_int64l_t acc_llong_t |
||
| 165 | # define acc_uint64l_t acc_ullong_t |
||
| 166 | # if (ACC_CC_BORLANDC) |
||
| 167 | # define ACC_INT64L_C(c) ((c) + 0ll) |
||
| 168 | # define ACC_UINT64L_C(c) ((c) + 0ull) |
||
| 169 | # else |
||
| 170 | # define ACC_INT64L_C(c) c##LL |
||
| 171 | # define ACC_UINT64L_C(c) c##ULL |
||
| 172 | # endif |
||
| 173 | # define SIZEOF_ACC_INT64L_T SIZEOF_LONG_LONG |
||
| 174 | #elif (SIZEOF___INT64 >= 8 && SIZEOF_UNSIGNED___INT64 >= 8) |
||
| 175 | # define acc_int64l_t __int64 |
||
| 176 | # define acc_uint64l_t unsigned __int64 |
||
| 177 | # if (ACC_CC_BORLANDC) |
||
| 178 | # define ACC_INT64L_C(c) ((c) + 0i64) |
||
| 179 | # define ACC_UINT64L_C(c) ((c) + 0ui64) |
||
| 180 | # else |
||
| 181 | # define ACC_INT64L_C(c) c##i64 |
||
| 182 | # define ACC_UINT64L_C(c) c##ui64 |
||
| 183 | # endif |
||
| 184 | # define SIZEOF_ACC_INT64L_T SIZEOF___INT64 |
||
| 185 | #else |
||
| 186 | /* no least 64-bit integral type on this machine */ |
||
| 187 | #endif |
||
| 188 | #endif |
||
| 189 | |||
| 190 | |||
| 191 | #if !defined(acc_intptr_t) |
||
| 192 | #if (ACC_ARCH_IA32 && ACC_CC_MSC && (_MSC_VER >= 1300)) |
||
| 193 | typedef __w64 int acc_intptr_t; |
||
| 194 | typedef __w64 unsigned int acc_uintptr_t; |
||
| 195 | # define acc_intptr_t acc_intptr_t |
||
| 196 | # define acc_uintptr_t acc_uintptr_t |
||
| 197 | # define SIZEOF_ACC_INTPTR_T SIZEOF_INT |
||
| 198 | #elif (SIZEOF_INT >= SIZEOF_VOID_P) |
||
| 199 | # define acc_intptr_t int |
||
| 200 | # define acc_uintptr_t unsigned int |
||
| 201 | # define SIZEOF_ACC_INTPTR_T SIZEOF_INT |
||
| 202 | #elif (SIZEOF_LONG >= SIZEOF_VOID_P) |
||
| 203 | # define acc_intptr_t long |
||
| 204 | # define acc_uintptr_t unsigned long |
||
| 205 | # define SIZEOF_ACC_INTPTR_T SIZEOF_LONG |
||
| 206 | #elif (SIZEOF_ACC_INT64L_T >= SIZEOF_VOID_P) |
||
| 207 | # define acc_intptr_t acc_int64l_t |
||
| 208 | # define acc_uintptr_t acc_uint64l_t |
||
| 209 | # define SIZEOF_ACC_INTPTR_T SIZEOF_ACC_INT64L_T |
||
| 210 | #else |
||
| 211 | # error "acc_intptr_t" |
||
| 212 | #endif |
||
| 213 | #endif |
||
| 214 | |||
| 215 | |||
| 216 | /* workaround for broken compilers */ |
||
| 217 | #if (ACC_BROKEN_INTEGRAL_CONSTANTS) |
||
| 218 | # undef ACC_INT32E_C |
||
| 219 | # undef ACC_UINT32E_C |
||
| 220 | # undef ACC_INT32L_C |
||
| 221 | # undef ACC_UINT32L_C |
||
| 222 | # undef ACC_INT32F_C |
||
| 223 | # undef ACC_UINT32F_C |
||
| 224 | # if (SIZEOF_INT == 4) |
||
| 225 | # define ACC_INT32E_C(c) ((c) + 0) |
||
| 226 | # define ACC_UINT32E_C(c) ((c) + 0U) |
||
| 227 | # define ACC_INT32L_C(c) ((c) + 0) |
||
| 228 | # define ACC_UINT32L_C(c) ((c) + 0U) |
||
| 229 | # define ACC_INT32F_C(c) ((c) + 0) |
||
| 230 | # define ACC_UINT32F_C(c) ((c) + 0U) |
||
| 231 | # elif (SIZEOF_LONG == 4) |
||
| 232 | # define ACC_INT32E_C(c) ((c) + 0L) |
||
| 233 | # define ACC_UINT32E_C(c) ((c) + 0UL) |
||
| 234 | # define ACC_INT32L_C(c) ((c) + 0L) |
||
| 235 | # define ACC_UINT32L_C(c) ((c) + 0UL) |
||
| 236 | # define ACC_INT32F_C(c) ((c) + 0L) |
||
| 237 | # define ACC_UINT32F_C(c) ((c) + 0UL) |
||
| 238 | # else |
||
| 239 | # error "integral constants" |
||
| 240 | # endif |
||
| 241 | #endif |
||
| 242 | |||
| 243 | |||
| 244 | /*********************************************************************** |
||
| 245 | // calling conventions |
||
| 246 | ************************************************************************/ |
||
| 247 | |||
| 248 | #if (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64) |
||
| 249 | # if (ACC_CC_GNUC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PACIFICC) |
||
| 250 | # elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC) |
||
| 251 | # define __acc_cdecl __cdecl |
||
| 252 | # define __acc_cdecl_atexit |
||
| 253 | # define __acc_cdecl_main __cdecl |
||
| 254 | # if (ACC_OS_OS2 && (ACC_CC_DMC || ACC_CC_SYMANTECC)) |
||
| 255 | # define __acc_cdecl_qsort __pascal |
||
| 256 | # elif (ACC_OS_OS2 && (ACC_CC_ZORTECHC)) |
||
| 257 | # define __acc_cdecl_qsort _stdcall |
||
| 258 | # else |
||
| 259 | # define __acc_cdecl_qsort __cdecl |
||
| 260 | # endif |
||
| 261 | # elif (ACC_CC_WATCOMC) |
||
| 262 | # define __acc_cdecl __cdecl |
||
| 263 | # else |
||
| 264 | # define __acc_cdecl __cdecl |
||
| 265 | # define __acc_cdecl_atexit __cdecl |
||
| 266 | # define __acc_cdecl_main __cdecl |
||
| 267 | # define __acc_cdecl_qsort __cdecl |
||
| 268 | # endif |
||
| 269 | # if (ACC_CC_GNUC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PACIFICC || ACC_CC_WATCOMC) |
||
| 270 | # elif (ACC_OS_OS2 && (ACC_CC_DMC || ACC_CC_SYMANTECC)) |
||
| 271 | # define __acc_cdecl_sighandler __pascal |
||
| 272 | # elif (ACC_OS_OS2 && (ACC_CC_ZORTECHC)) |
||
| 273 | # define __acc_cdecl_sighandler _stdcall |
||
| 274 | # elif (ACC_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE) |
||
| 275 | # define __acc_cdecl_sighandler __clrcall |
||
| 276 | # elif (ACC_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700)) |
||
| 277 | # if defined(_DLL) |
||
| 278 | # define __acc_cdecl_sighandler _far _cdecl _loadds |
||
| 279 | # elif defined(_MT) |
||
| 280 | # define __acc_cdecl_sighandler _far _cdecl |
||
| 281 | # else |
||
| 282 | # define __acc_cdecl_sighandler _cdecl |
||
| 283 | # endif |
||
| 284 | # else |
||
| 285 | # define __acc_cdecl_sighandler __cdecl |
||
| 286 | # endif |
||
| 287 | #elif (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC)) |
||
| 288 | # define __acc_cdecl cdecl |
||
| 289 | #endif |
||
| 290 | |||
| 291 | #if !defined(__acc_cdecl) |
||
| 292 | # define __acc_cdecl |
||
| 293 | #endif |
||
| 294 | #if !defined(__acc_cdecl_atexit) |
||
| 295 | # define __acc_cdecl_atexit |
||
| 296 | #endif |
||
| 297 | #if !defined(__acc_cdecl_main) |
||
| 298 | # define __acc_cdecl_main |
||
| 299 | #endif |
||
| 300 | #if !defined(__acc_cdecl_qsort) |
||
| 301 | # define __acc_cdecl_qsort |
||
| 302 | #endif |
||
| 303 | #if !defined(__acc_cdecl_sighandler) |
||
| 304 | # define __acc_cdecl_sighandler |
||
| 305 | #endif |
||
| 306 | #if !defined(__acc_cdecl_va) |
||
| 307 | # define __acc_cdecl_va __acc_cdecl |
||
| 308 | #endif |
||
| 309 | |||
| 310 | #if (ACC_BROKEN_CDECL_ALT_SYNTAX) |
||
| 311 | typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(int); |
||
| 312 | #elif defined(RETSIGTYPE) |
||
| 313 | typedef RETSIGTYPE (__acc_cdecl_sighandler *acc_sighandler_t)(int); |
||
| 314 | #else |
||
| 315 | typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(int); |
||
| 316 | #endif |
||
| 317 | |||
| 318 | |||
| 319 | /* |
||
| 320 | vi:ts=4:et |
||
| 321 | */ |