10 #ifndef util_misc_scint_h
11 #define util_misc_scint_h
21 typedef int8_t sc_int8_t;
22 typedef int_least8_t sc_int_least8_t;
23 typedef int_fast8_t sc_int_fast8_t;
24 typedef uint8_t sc_uint8_t;
25 typedef uint_least8_t sc_uint_least8_t;
26 typedef uint_fast8_t sc_uint_fast8_t;
28 typedef int16_t sc_int16_t;
29 typedef int_least16_t sc_int_least16_t;
30 typedef int_fast16_t sc_int_fast16_t;
31 typedef uint16_t sc_uint16_t;
32 typedef uint_least16_t sc_uint_least16_t;
33 typedef uint_fast16_t sc_uint_fast16_t;
35 typedef int32_t sc_int32_t;
36 typedef int_least32_t sc_int_least32_t;
37 typedef int_fast32_t sc_int_fast32_t;
38 typedef uint32_t sc_uint32_t;
39 typedef uint_least32_t sc_uint_least32_t;
40 typedef uint_fast32_t sc_uint_fast32_t;
42 typedef intmax_t sc_intmax_t;
43 typedef uintmax_t sc_uintmax_t;
44 typedef int64_t sc_int64_t;
45 typedef int_least64_t sc_int_least64_t;
46 typedef int_fast64_t sc_int_fast64_t;
47 typedef uint64_t sc_uint64_t;
48 typedef uint_least64_t sc_uint_least64_t;
49 typedef uint_fast64_t sc_uint_fast64_t;
70 # if UCHAR_MAX == 0xff
71 typedef signed char sc_int8_t;
72 typedef signed char sc_int_least8_t;
73 typedef signed char sc_int_fast8_t;
74 typedef unsigned char sc_uint8_t;
75 typedef unsigned char sc_uint_least8_t;
76 typedef unsigned char sc_uint_fast8_t;
78 # error defaults not correct; you must hand modify scint.h
83 # if USHRT_MAX == 0xffff
84 typedef short sc_int16_t;
85 typedef short sc_int_least16_t;
86 typedef short sc_int_fast16_t;
87 typedef unsigned short sc_uint16_t;
88 typedef unsigned short sc_uint_least16_t;
89 typedef unsigned short sc_uint_fast16_t;
91 # error defaults not correct; you must hand modify scint.h
96 # if UINT_MAX == 0xffffffff
97 typedef int sc_int32_t;
98 typedef int sc_int_least32_t;
99 typedef int sc_int_fast32_t;
100 typedef unsigned int sc_uint32_t;
101 typedef unsigned int sc_uint_least32_t;
102 typedef unsigned int sc_uint_fast32_t;
103 # elif ULONG_MAX == 0xffffffff
104 typedef long sc_int32_t;
105 typedef long sc_int_least32_t;
106 typedef long sc_int_fast32_t;
107 typedef unsigned long sc_uint32_t;
108 typedef unsigned long sc_uint_least32_t;
109 typedef unsigned long sc_uint_fast32_t;
111 # error defaults not correct; you must hand modify scint.h
116 #if defined(ULONGLONG_MAX) && !defined(ULLONG_MAX)
117 # define ULLONG_MAX ULONGLONG_MAX
122 # if ULONGLONG_MAX == (0xffffffffffffffffuLL) // uLL reqd for xlC
123 typedef long long sc_intmax_t;
124 typedef unsigned long long sc_uintmax_t;
125 typedef long long sc_int64_t;
126 typedef long long sc_int_least64_t;
127 typedef long long sc_int_fast64_t;
128 typedef unsigned long long sc_uint64_t;
129 typedef unsigned long long sc_uint_least64_t;
130 typedef unsigned long long sc_uint_fast64_t;
132 # error defaults not correct; you must hand modify scint.h
134 # elif ULONG_MAX != 0xffffffff
136 # if ULONG_MAX == 18446744073709551615 // 2**64 - 1
137 typedef long sc_intmax_t;
138 typedef unsigned long sc_uintmax_t;
139 typedef long sc_int64_t;
140 typedef long sc_int_least64_t;
141 typedef long sc_int_fast64_t;
142 typedef unsigned long sc_uint64_t;
143 typedef unsigned long sc_uint_least64_t;
144 typedef unsigned long sc_uint_fast64_t;
146 # error defaults not correct; you must hand modify scint.h
148 # else // assume no 64-bit integers
149 # error 64 bit integer types are required
150 typedef sc_int32_t sc_intmax_t;
151 typedef sc_uint32_t sc_uintmax_t;