lib: Add missing bits to stddef.h, stdint.h; pointers are "long"
[profile/ivi/syslinux.git] / com32 / include / stdint.h
1 /*
2  * stdint.h
3  */
4
5 #ifndef _STDINT_H
6 #define _STDINT_H
7
8 /* Exact types */
9
10 typedef signed char int8_t;
11 typedef signed short int16_t;
12 typedef signed int int32_t;
13 typedef signed long long int64_t;
14
15 typedef unsigned char uint8_t;
16 typedef unsigned short uint16_t;
17 typedef unsigned int uint32_t;
18 typedef unsigned long long uint64_t;
19
20 /* Small types */
21
22 typedef signed char int_least8_t;
23 typedef signed short int_least16_t;
24 typedef signed int int_least32_t;
25 typedef signed long long int_least64_t;
26
27 typedef unsigned char uint_least8_t;
28 typedef unsigned short uint_least16_t;
29 typedef unsigned int uint_least32_t;
30 typedef unsigned long long uint_least64_t;
31
32 /* Fast types */
33
34 typedef signed char int_fast8_t;
35 typedef signed short int_fast16_t;
36 typedef signed int int_fast32_t;
37 typedef signed long long int_fast64_t;
38
39 typedef unsigned char uint_fast8_t;
40 typedef unsigned short uint_fast16_t;
41 typedef unsigned int uint_fast32_t;
42 typedef unsigned long long uint_fast64_t;
43
44 /* Pointer types */
45
46 typedef signed long intptr_t;
47 typedef unsigned long uintptr_t;
48
49 /* Maximal types */
50
51 typedef int64_t intmax_t;
52 typedef uint64_t uintmax_t;
53
54 /* Rank definitions, used in inttypes.h */
55 #define __PRIFAST_RANK  ""
56 #define __SCNFAST_RANK  ""
57 #define __PRIPTR_RANK   "l"
58 #define __SCNPTR_RANK   "l"
59 #define __PRI64_RANK    "ll"
60 #define __SCN64_RANK    "ll"
61
62 /*
63  * To be strictly correct...
64  */
65 #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
66
67 # define INT8_MIN               (-128)
68 # define INT16_MIN              (-32767-1)
69 # define INT32_MIN              (-2147483647-1)
70 # define INT64_MIN              (-9223372036854775807LL-1)
71
72 # define INT8_MAX               (127)
73 # define INT16_MAX              (32767)
74 # define INT32_MAX              (2147483647)
75 # define INT64_MAX              (9223372036854775807LL)
76
77 # define UINT8_MAX              (255U)
78 # define UINT16_MAX             (65535U)
79 # define UINT32_MAX             (4294967295U)
80 # define UINT64_MAX             (18446744073709551615ULL)
81
82 # define INT_LEAST8_MIN               (-128)
83 # define INT_LEAST16_MIN              (-32767-1)
84 # define INT_LEAST32_MIN              (-2147483647-1)
85 # define INT_LEAST64_MIN              (-9223372036854775807LL-1)
86
87 # define INT_LEAST8_MAX               (127)
88 # define INT_LEAST16_MAX              (32767)
89 # define INT_LEAST32_MAX              (2147483647)
90 # define INT_LEAST64_MAX              (9223372036854775807LL)
91
92 # define UINT_LEAST8_MAX              (255U)
93 # define UINT_LEAST16_MAX             (65535U)
94 # define UINT_LEAST32_MAX             (4294967295U)
95 # define UINT_LEAST64_MAX             (18446744073709551615ULL)
96
97 # define INT_FAST8_MIN               (-128)
98 # define INT_FAST16_MIN              (-32767-1)
99 # define INT_FAST32_MIN              (-2147483647-1)
100 # define INT_FAST64_MIN              (-9223372036854775807LL-1)
101
102 # define INT_FAST8_MAX               (127)
103 # define INT_FAST16_MAX              (32767)
104 # define INT_FAST32_MAX              (2147483647)
105 # define INT_FAST64_MAX              (9223372036854775807LL)
106
107 # define UINT_FAST8_MAX              (255U)
108 # define UINT_FAST16_MAX             (65535U)
109 # define UINT_FAST32_MAX             (4294967295U)
110 # define UINT_FAST64_MAX             (18446744073709551615ULL)
111
112 # define INTPTR_MIN             (-2147483647-1)
113 # define INTPTR_MAX             (2147483647)
114 # define UINTPTR_MAX            (4294967295U)
115
116 # define INTMAX_MIN             (-9223372036854775807LL-1)
117 # define INTMAX_MAX             (9223372036854775807LL)
118 # define UINTMAX_MAX            (18446744073709551615ULL)
119
120 /* ptrdiff_t limit */
121 # define PTRDIFF_MIN            (-2147483647-1)
122 # define PTRDIFF_MAX            (2147483647)
123
124 /* sig_atomic_t limit */
125 # define SIG_ATOMIC_MIN         (-2147483647-1)
126 # define SIG_ATOMIC_MAX         (2147483647)
127
128 /* size_t limit */
129 # define SIZE_MAX               (4294967295U)
130
131 #endif /* STDC_LIMIT_MACROS */
132
133 #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
134
135 # define INT8_C(n)      n
136 # define INT16_C(n)     n
137 # define INT32_C(n)     n
138 # define INT64_C(n)     n ## LL
139
140 # define UINT8_C(n)     n ## U
141 # define UINT16_C(n)    n ## U
142 # define UINT32_C(n)    n ## U
143 # define UINT64_C(n)    n ## ULL
144
145 # define INTMAX_C(n)    n ## LL
146 # define UINTMAX_C(n)   n ## ULL
147
148 #endif /* STDC_CONSTANT_MACROS */
149
150 #endif /* _STDINT_H */