1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #ifndef PHP_STDINT_H
20 #define PHP_STDINT_H
21
22 #if defined(_MSC_VER)
23
24
25
26
27
28 # if !defined(_STDINT)
29 # define _STDINT
30 # include "win32/php_stdint.h"
31 # endif
32 # define HAVE_INT8_T 1
33 # define HAVE_UINT8_T 1
34 # define HAVE_INT16_T 1
35 # define HAVE_UINT16_T 1
36 # define HAVE_INT32_T 1
37 # define HAVE_UINT32_T 1
38 # define HAVE_INT64_T 1
39 # define HAVE_UINT64_T 1
40 #else
41
42 #include "php_config.h"
43
44 #if HAVE_SYS_TYPES_H
45 # include <sys/types.h>
46 #endif
47
48 #if HAVE_INTTYPES_H
49 # include <inttypes.h>
50 #endif
51
52 #if HAVE_STDINT_H
53 # include <stdint.h>
54 #endif
55
56 #ifndef HAVE_INT8_T
57 # ifdef HAVE_INT8
58 typedef int8 int8_t;
59 # else
60 typedef signed char int8_t;
61 # endif
62 #endif
63
64 #ifndef INT8_C
65 # define INT8_C(c) c
66 #endif
67
68 #ifndef HAVE_UINT8_T
69 # ifdef HAVE_UINT8
70 typedef uint8 uint8_t
71 # elif HAVE_U_INT8_T
72 typedef u_int8_t uint8_t;
73 # else
74 typedef unsigned char uint8_t;
75 # endif
76 #endif
77
78 #ifndef UINT8_C
79 # define UINT8_C(c) c
80 #endif
81
82 #ifndef HAVE_INT16_T
83 # ifdef HAVE_INT16
84 typedef int16 int16_t;
85 # elif SIZEOF_SHORT >= 2
86 typedef signed short int16_t;
87 # else
88 # error "No suitable 16bit integer type found"
89 # endif
90 #endif
91
92 #ifndef INT16_C
93 # define INT16_C(c) c
94 #endif
95
96 #ifndef HAVE_UINT16_T
97 # ifdef HAVE_UINT16
98 typedef uint16 uint16_t
99 # elif HAVE_U_INT16_T
100 typedef u_int16_t uint16_t;
101 # elif SIZEOF_SHORT >= 2
102 typedef unsigned short uint16_t;
103 # else
104 # error "No suitable 16bit integer type found"
105 # endif
106 #endif
107
108 #ifndef UINT16_C
109 # define UINT16_C(c) c
110 #endif
111
112 #ifndef HAVE_INT32_T
113 # ifdef HAVE_INT32
114 typedef int32 int32_t;
115 # elif SIZEOF_INT >= 4
116 typedef int int32_t;
117 # elif SIZEOF_LONG >= 4
118 typedef long int32_t;
119 # else
120 # error "No suitable 32bit integer type found"
121 # endif
122 #endif
123
124 #ifndef INT32_C
125 # define INT32_C(c) c
126 #endif
127
128 #ifndef HAVE_UINT32_T
129 # ifdef HAVE_UINT32
130 typedef uint32 uint32_t
131 # elif HAVE_U_INT32_T
132 typedef u_int32_t uint32_t;
133 # elif SIZEOF_INT >= 4
134 typedef unsigned int uint32_t;
135 # elif SIZEOF_LONG >= 4
136 typedef unsigned long uint32_t;
137 # else
138 # error "No suitable 32bit integer type found"
139 # endif
140 #endif
141
142 #ifndef UINT32_C
143 # define UINT32_C(c) c ## U
144 #endif
145
146 #ifndef HAVE_INT64_T
147 # ifdef HAVE_INT64
148 typedef int64 int64_t;
149 # elif SIZEOF_INT >= 8
150 typedef int int64_t;
151 # elif SIZEOF_LONG >= 8
152 typedef long int64_t;
153 # elif SIZEOF_LONG_LONG >= 8
154 typedef long long int64_t;
155 # else
156 # error "No suitable 64bit integer type found"
157 # endif
158 #endif
159
160 #ifndef INT64_C
161 # if SIZEOF_INT >= 8
162 # define INT64_C(c) c
163 # elif SIZEOF_LONG >= 8
164 # define INT64_C(c) c ## L
165 # elif SIZEOF_LONG_LONG >= 8
166 # define INT64_C(c) c ## LL
167 # endif
168 #endif
169
170 #ifndef HAVE_UINT64_T
171 # ifdef HAVE_UINT64
172 typedef uint64 uint64_t
173 # elif HAVE_U_INT64_T
174 typedef u_int64_t uint64_t;
175 # elif SIZEOF_INT >= 8
176 typedef unsigned int uint64_t;
177 # elif SIZEOF_LONG >= 8
178 typedef unsigned long uint64_t;
179 # elif SIZEOF_LONG_LONG >= 8
180 typedef unsigned long long uint64_t;
181 # else
182 # error "No suitable 64bit integer type found"
183 # endif
184 #endif
185
186 #ifndef UINT64_C
187 # if SIZEOF_INT >= 8
188 # define UINT64_C(c) c ## U
189 # elif SIZEOF_LONG >= 8
190 # define UINT64_C(c) c ## UL
191 # elif SIZEOF_LONG_LONG >= 8
192 # define UINT64_C(c) c ## ULL
193 # endif
194 #endif
195
196 #endif
197 #endif
198
199
200
201
202
203
204
205
206