2 Portable header to provide the 32 and 64 bits type.
4 Not a compatible replacement for <stdint.h>, do not blindly use it as such.
7 #if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__WATCOMC__) && (defined(_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_) || defined(__UINT_FAST64_TYPE__)) )) && !defined(FIXEDINT_H_INCLUDED)
9 #define FIXEDINT_H_INCLUDED
11 #if defined(__WATCOMC__) && __WATCOMC__ >= 1250 && !defined(UINT64_C)
13 #define UINT64_C(x) (x + (UINT64_MAX - UINT64_MAX))
18 #ifndef FIXEDINT_H_INCLUDED
19 #define FIXEDINT_H_INCLUDED
23 #if (ULONG_MAX == 0xffffffffUL)
24 typedef unsigned long uint32_t;
25 #elif (UINT_MAX == 0xffffffffUL)
26 typedef unsigned int uint32_t;
27 #elif (USHRT_MAX == 0xffffffffUL)
28 typedef unsigned short uint32_t;
34 #if (LONG_MAX == 0x7fffffffL)
35 typedef signed long int32_t;
36 #elif (INT_MAX == 0x7fffffffL)
37 typedef signed int int32_t;
38 #elif (SHRT_MAX == 0x7fffffffL)
39 typedef signed short int32_t;
45 #if (defined(__STDC__) && defined(__STDC_VERSION__) && __STDC__ && __STDC_VERSION__ >= 199901L)
46 typedef long long int64_t;
47 typedef unsigned long long uint64_t;
49 #define UINT64_C(v) v ##ULL
50 #define INT64_C(v) v ##LL
51 #elif defined(__GNUC__)
52 __extension__ typedef long long int64_t;
53 __extension__ typedef unsigned long long uint64_t;
55 #define UINT64_C(v) v ##ULL
56 #define INT64_C(v) v ##LL
57 #elif defined(__MWERKS__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(__APPLE_CC__) || defined(_LONG_LONG) || defined(_CRAYC)
58 typedef long long int64_t;
59 typedef unsigned long long uint64_t;
61 #define UINT64_C(v) v ##ULL
62 #define INT64_C(v) v ##LL
63 #elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined(__BORLANDC__) && __BORLANDC__ > 0x460) || defined(__alpha) || defined(__DECC)
64 typedef __int64 int64_t;
65 typedef unsigned __int64 uint64_t;
67 #define UINT64_C(v) v ##UI64
68 #define INT64_C(v) v ##I64