1 | #ifndef CURLINC_SYSTEM_H |
2 | #define CURLINC_SYSTEM_H |
3 | /*************************************************************************** |
4 | * _ _ ____ _ |
5 | * Project ___| | | | _ \| | |
6 | * / __| | | | |_) | | |
7 | * | (__| |_| | _ <| |___ |
8 | * \___|\___/|_| \_\_____| |
9 | * |
10 | * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. |
11 | * |
12 | * This software is licensed as described in the file COPYING, which |
13 | * you should have received as part of this distribution. The terms |
14 | * are also available at https://curl.se/docs/copyright.html. |
15 | * |
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell |
17 | * copies of the Software, and permit persons to whom the Software is |
18 | * furnished to do so, under the terms of the COPYING file. |
19 | * |
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
21 | * KIND, either express or implied. |
22 | * |
23 | * SPDX-License-Identifier: curl |
24 | * |
25 | ***************************************************************************/ |
26 | |
27 | /* |
28 | * Try to keep one section per platform, compiler and architecture, otherwise, |
29 | * if an existing section is reused for a different one and later on the |
30 | * original is adjusted, probably the piggybacking one can be adversely |
31 | * changed. |
32 | * |
33 | * In order to differentiate between platforms/compilers/architectures use |
34 | * only compiler built in predefined preprocessor symbols. |
35 | * |
36 | * curl_off_t |
37 | * ---------- |
38 | * |
39 | * For any given platform/compiler curl_off_t must be typedef'ed to a 64-bit |
40 | * wide signed integral data type. The width of this data type must remain |
41 | * constant and independent of any possible large file support settings. |
42 | * |
43 | * As an exception to the above, curl_off_t shall be typedef'ed to a 32-bit |
44 | * wide signed integral data type if there is no 64-bit type. |
45 | * |
46 | * As a general rule, curl_off_t shall not be mapped to off_t. This rule shall |
47 | * only be violated if off_t is the only 64-bit data type available and the |
48 | * size of off_t is independent of large file support settings. Keep your |
49 | * build on the safe side avoiding an off_t gating. If you have a 64-bit |
50 | * off_t then take for sure that another 64-bit data type exists, dig deeper |
51 | * and you will find it. |
52 | * |
53 | */ |
54 | |
55 | #if defined(__DJGPP__) || defined(__GO32__) |
56 | # if defined(__DJGPP__) && (__DJGPP__ > 1) |
57 | # define CURL_TYPEOF_CURL_OFF_T long long |
58 | # define CURL_FORMAT_CURL_OFF_T "lld" |
59 | # define CURL_FORMAT_CURL_OFF_TU "llu" |
60 | # define CURL_SUFFIX_CURL_OFF_T LL |
61 | # define CURL_SUFFIX_CURL_OFF_TU ULL |
62 | # else |
63 | # define CURL_TYPEOF_CURL_OFF_T long |
64 | # define CURL_FORMAT_CURL_OFF_T "ld" |
65 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
66 | # define CURL_SUFFIX_CURL_OFF_T L |
67 | # define CURL_SUFFIX_CURL_OFF_TU UL |
68 | # endif |
69 | # define CURL_TYPEOF_CURL_SOCKLEN_T int |
70 | |
71 | #elif defined(__SALFORDC__) |
72 | # define CURL_TYPEOF_CURL_OFF_T long |
73 | # define CURL_FORMAT_CURL_OFF_T "ld" |
74 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
75 | # define CURL_SUFFIX_CURL_OFF_T L |
76 | # define CURL_SUFFIX_CURL_OFF_TU UL |
77 | # define CURL_TYPEOF_CURL_SOCKLEN_T int |
78 | |
79 | #elif defined(__BORLANDC__) |
80 | # if (__BORLANDC__ < 0x520) |
81 | # define CURL_TYPEOF_CURL_OFF_T long |
82 | # define CURL_FORMAT_CURL_OFF_T "ld" |
83 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
84 | # define CURL_SUFFIX_CURL_OFF_T L |
85 | # define CURL_SUFFIX_CURL_OFF_TU UL |
86 | # else |
87 | # define CURL_TYPEOF_CURL_OFF_T __int64 |
88 | # define CURL_FORMAT_CURL_OFF_T "I64d" |
89 | # define CURL_FORMAT_CURL_OFF_TU "I64u" |
90 | # define CURL_SUFFIX_CURL_OFF_T i64 |
91 | # define CURL_SUFFIX_CURL_OFF_TU ui64 |
92 | # endif |
93 | # define CURL_TYPEOF_CURL_SOCKLEN_T int |
94 | |
95 | #elif defined(__TURBOC__) |
96 | # define CURL_TYPEOF_CURL_OFF_T long |
97 | # define CURL_FORMAT_CURL_OFF_T "ld" |
98 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
99 | # define CURL_SUFFIX_CURL_OFF_T L |
100 | # define CURL_SUFFIX_CURL_OFF_TU UL |
101 | # define CURL_TYPEOF_CURL_SOCKLEN_T int |
102 | |
103 | #elif defined(__POCC__) |
104 | # if (__POCC__ < 280) |
105 | # define CURL_TYPEOF_CURL_OFF_T long |
106 | # define CURL_FORMAT_CURL_OFF_T "ld" |
107 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
108 | # define CURL_SUFFIX_CURL_OFF_T L |
109 | # define CURL_SUFFIX_CURL_OFF_TU UL |
110 | # elif defined(_MSC_VER) |
111 | # define CURL_TYPEOF_CURL_OFF_T __int64 |
112 | # define CURL_FORMAT_CURL_OFF_T "I64d" |
113 | # define CURL_FORMAT_CURL_OFF_TU "I64u" |
114 | # define CURL_SUFFIX_CURL_OFF_T i64 |
115 | # define CURL_SUFFIX_CURL_OFF_TU ui64 |
116 | # else |
117 | # define CURL_TYPEOF_CURL_OFF_T long long |
118 | # define CURL_FORMAT_CURL_OFF_T "lld" |
119 | # define CURL_FORMAT_CURL_OFF_TU "llu" |
120 | # define CURL_SUFFIX_CURL_OFF_T LL |
121 | # define CURL_SUFFIX_CURL_OFF_TU ULL |
122 | # endif |
123 | # define CURL_TYPEOF_CURL_SOCKLEN_T int |
124 | |
125 | #elif defined(__LCC__) |
126 | # if defined(__MCST__) /* MCST eLbrus Compiler Collection */ |
127 | # define CURL_TYPEOF_CURL_OFF_T long |
128 | # define CURL_FORMAT_CURL_OFF_T "ld" |
129 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
130 | # define CURL_SUFFIX_CURL_OFF_T L |
131 | # define CURL_SUFFIX_CURL_OFF_TU UL |
132 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
133 | # define CURL_PULL_SYS_TYPES_H 1 |
134 | # define CURL_PULL_SYS_SOCKET_H 1 |
135 | # else /* Local (or Little) C Compiler */ |
136 | # define CURL_TYPEOF_CURL_OFF_T long |
137 | # define CURL_FORMAT_CURL_OFF_T "ld" |
138 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
139 | # define CURL_SUFFIX_CURL_OFF_T L |
140 | # define CURL_SUFFIX_CURL_OFF_TU UL |
141 | # define CURL_TYPEOF_CURL_SOCKLEN_T int |
142 | # endif |
143 | |
144 | #elif defined(macintosh) |
145 | # include <ConditionalMacros.h> |
146 | # if TYPE_LONGLONG |
147 | # define CURL_TYPEOF_CURL_OFF_T long long |
148 | # define CURL_FORMAT_CURL_OFF_T "lld" |
149 | # define CURL_FORMAT_CURL_OFF_TU "llu" |
150 | # define CURL_SUFFIX_CURL_OFF_T LL |
151 | # define CURL_SUFFIX_CURL_OFF_TU ULL |
152 | # else |
153 | # define CURL_TYPEOF_CURL_OFF_T long |
154 | # define CURL_FORMAT_CURL_OFF_T "ld" |
155 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
156 | # define CURL_SUFFIX_CURL_OFF_T L |
157 | # define CURL_SUFFIX_CURL_OFF_TU UL |
158 | # endif |
159 | # define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int |
160 | |
161 | #elif defined(__TANDEM) |
162 | # if ! defined(__LP64) |
163 | /* Required for 32-bit NonStop builds only. */ |
164 | # define CURL_TYPEOF_CURL_OFF_T long long |
165 | # define CURL_FORMAT_CURL_OFF_T "lld" |
166 | # define CURL_FORMAT_CURL_OFF_TU "llu" |
167 | # define CURL_SUFFIX_CURL_OFF_T LL |
168 | # define CURL_SUFFIX_CURL_OFF_TU ULL |
169 | # define CURL_TYPEOF_CURL_SOCKLEN_T int |
170 | # endif |
171 | |
172 | #elif defined(_WIN32_WCE) |
173 | # define CURL_TYPEOF_CURL_OFF_T __int64 |
174 | # define CURL_FORMAT_CURL_OFF_T "I64d" |
175 | # define CURL_FORMAT_CURL_OFF_TU "I64u" |
176 | # define CURL_SUFFIX_CURL_OFF_T i64 |
177 | # define CURL_SUFFIX_CURL_OFF_TU ui64 |
178 | # define CURL_TYPEOF_CURL_SOCKLEN_T int |
179 | |
180 | #elif defined(__MINGW32__) |
181 | # include <inttypes.h> |
182 | # define CURL_TYPEOF_CURL_OFF_T long long |
183 | # define CURL_FORMAT_CURL_OFF_T PRId64 |
184 | # define CURL_FORMAT_CURL_OFF_TU PRIu64 |
185 | # define CURL_SUFFIX_CURL_OFF_T LL |
186 | # define CURL_SUFFIX_CURL_OFF_TU ULL |
187 | # define CURL_TYPEOF_CURL_SOCKLEN_T int |
188 | # define CURL_PULL_SYS_TYPES_H 1 |
189 | |
190 | #elif defined(__VMS) |
191 | # if defined(__VAX) |
192 | # define CURL_TYPEOF_CURL_OFF_T long |
193 | # define CURL_FORMAT_CURL_OFF_T "ld" |
194 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
195 | # define CURL_SUFFIX_CURL_OFF_T L |
196 | # define CURL_SUFFIX_CURL_OFF_TU UL |
197 | # else |
198 | # define CURL_TYPEOF_CURL_OFF_T long long |
199 | # define CURL_FORMAT_CURL_OFF_T "lld" |
200 | # define CURL_FORMAT_CURL_OFF_TU "llu" |
201 | # define CURL_SUFFIX_CURL_OFF_T LL |
202 | # define CURL_SUFFIX_CURL_OFF_TU ULL |
203 | # endif |
204 | # define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int |
205 | |
206 | #elif defined(__OS400__) |
207 | # define CURL_TYPEOF_CURL_OFF_T long long |
208 | # define CURL_FORMAT_CURL_OFF_T "lld" |
209 | # define CURL_FORMAT_CURL_OFF_TU "llu" |
210 | # define CURL_SUFFIX_CURL_OFF_T LL |
211 | # define CURL_SUFFIX_CURL_OFF_TU ULL |
212 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
213 | # define CURL_PULL_SYS_TYPES_H 1 |
214 | # define CURL_PULL_SYS_SOCKET_H 1 |
215 | |
216 | #elif defined(__MVS__) |
217 | # if defined(_LONG_LONG) |
218 | # define CURL_TYPEOF_CURL_OFF_T long long |
219 | # define CURL_FORMAT_CURL_OFF_T "lld" |
220 | # define CURL_FORMAT_CURL_OFF_TU "llu" |
221 | # define CURL_SUFFIX_CURL_OFF_T LL |
222 | # define CURL_SUFFIX_CURL_OFF_TU ULL |
223 | # elif defined(_LP64) |
224 | # define CURL_TYPEOF_CURL_OFF_T long |
225 | # define CURL_FORMAT_CURL_OFF_T "ld" |
226 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
227 | # define CURL_SUFFIX_CURL_OFF_T L |
228 | # define CURL_SUFFIX_CURL_OFF_TU UL |
229 | # else |
230 | # define CURL_TYPEOF_CURL_OFF_T long |
231 | # define CURL_FORMAT_CURL_OFF_T "ld" |
232 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
233 | # define CURL_SUFFIX_CURL_OFF_T L |
234 | # define CURL_SUFFIX_CURL_OFF_TU UL |
235 | # endif |
236 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
237 | # define CURL_PULL_SYS_TYPES_H 1 |
238 | # define CURL_PULL_SYS_SOCKET_H 1 |
239 | |
240 | #elif defined(__370__) |
241 | # if defined(__IBMC__) || defined(__IBMCPP__) |
242 | # if defined(_ILP32) |
243 | # elif defined(_LP64) |
244 | # endif |
245 | # if defined(_LONG_LONG) |
246 | # define CURL_TYPEOF_CURL_OFF_T long long |
247 | # define CURL_FORMAT_CURL_OFF_T "lld" |
248 | # define CURL_FORMAT_CURL_OFF_TU "llu" |
249 | # define CURL_SUFFIX_CURL_OFF_T LL |
250 | # define CURL_SUFFIX_CURL_OFF_TU ULL |
251 | # elif defined(_LP64) |
252 | # define CURL_TYPEOF_CURL_OFF_T long |
253 | # define CURL_FORMAT_CURL_OFF_T "ld" |
254 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
255 | # define CURL_SUFFIX_CURL_OFF_T L |
256 | # define CURL_SUFFIX_CURL_OFF_TU UL |
257 | # else |
258 | # define CURL_TYPEOF_CURL_OFF_T long |
259 | # define CURL_FORMAT_CURL_OFF_T "ld" |
260 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
261 | # define CURL_SUFFIX_CURL_OFF_T L |
262 | # define CURL_SUFFIX_CURL_OFF_TU UL |
263 | # endif |
264 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
265 | # define CURL_PULL_SYS_TYPES_H 1 |
266 | # define CURL_PULL_SYS_SOCKET_H 1 |
267 | # endif |
268 | |
269 | #elif defined(TPF) |
270 | # define CURL_TYPEOF_CURL_OFF_T long |
271 | # define CURL_FORMAT_CURL_OFF_T "ld" |
272 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
273 | # define CURL_SUFFIX_CURL_OFF_T L |
274 | # define CURL_SUFFIX_CURL_OFF_TU UL |
275 | # define CURL_TYPEOF_CURL_SOCKLEN_T int |
276 | |
277 | #elif defined(__TINYC__) /* also known as tcc */ |
278 | # define CURL_TYPEOF_CURL_OFF_T long long |
279 | # define CURL_FORMAT_CURL_OFF_T "lld" |
280 | # define CURL_FORMAT_CURL_OFF_TU "llu" |
281 | # define CURL_SUFFIX_CURL_OFF_T LL |
282 | # define CURL_SUFFIX_CURL_OFF_TU ULL |
283 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
284 | # define CURL_PULL_SYS_TYPES_H 1 |
285 | # define CURL_PULL_SYS_SOCKET_H 1 |
286 | |
287 | #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Oracle Solaris Studio */ |
288 | # if !defined(__LP64) && (defined(__ILP32) || \ |
289 | defined(__i386) || \ |
290 | defined(__sparcv8) || \ |
291 | defined(__sparcv8plus)) |
292 | # define CURL_TYPEOF_CURL_OFF_T long long |
293 | # define CURL_FORMAT_CURL_OFF_T "lld" |
294 | # define CURL_FORMAT_CURL_OFF_TU "llu" |
295 | # define CURL_SUFFIX_CURL_OFF_T LL |
296 | # define CURL_SUFFIX_CURL_OFF_TU ULL |
297 | # elif defined(__LP64) || \ |
298 | defined(__amd64) || defined(__sparcv9) |
299 | # define CURL_TYPEOF_CURL_OFF_T long |
300 | # define CURL_FORMAT_CURL_OFF_T "ld" |
301 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
302 | # define CURL_SUFFIX_CURL_OFF_T L |
303 | # define CURL_SUFFIX_CURL_OFF_TU UL |
304 | # endif |
305 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
306 | # define CURL_PULL_SYS_TYPES_H 1 |
307 | # define CURL_PULL_SYS_SOCKET_H 1 |
308 | |
309 | #elif defined(__xlc__) /* IBM xlc compiler */ |
310 | # if !defined(_LP64) |
311 | # define CURL_TYPEOF_CURL_OFF_T long long |
312 | # define CURL_FORMAT_CURL_OFF_T "lld" |
313 | # define CURL_FORMAT_CURL_OFF_TU "llu" |
314 | # define CURL_SUFFIX_CURL_OFF_T LL |
315 | # define CURL_SUFFIX_CURL_OFF_TU ULL |
316 | # else |
317 | # define CURL_TYPEOF_CURL_OFF_T long |
318 | # define CURL_FORMAT_CURL_OFF_T "ld" |
319 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
320 | # define CURL_SUFFIX_CURL_OFF_T L |
321 | # define CURL_SUFFIX_CURL_OFF_TU UL |
322 | # endif |
323 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
324 | # define CURL_PULL_SYS_TYPES_H 1 |
325 | # define CURL_PULL_SYS_SOCKET_H 1 |
326 | |
327 | #elif defined(__hpux) /* HP aCC compiler */ |
328 | # if !defined(_LP64) |
329 | # define CURL_TYPEOF_CURL_OFF_T long long |
330 | # define CURL_FORMAT_CURL_OFF_T "lld" |
331 | # define CURL_FORMAT_CURL_OFF_TU "llu" |
332 | # define CURL_SUFFIX_CURL_OFF_T LL |
333 | # define CURL_SUFFIX_CURL_OFF_TU ULL |
334 | # else |
335 | # define CURL_TYPEOF_CURL_OFF_T long |
336 | # define CURL_FORMAT_CURL_OFF_T "ld" |
337 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
338 | # define CURL_SUFFIX_CURL_OFF_T L |
339 | # define CURL_SUFFIX_CURL_OFF_TU UL |
340 | # endif |
341 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
342 | # define CURL_PULL_SYS_TYPES_H 1 |
343 | # define CURL_PULL_SYS_SOCKET_H 1 |
344 | |
345 | /* ===================================== */ |
346 | /* KEEP MSVC THE PENULTIMATE ENTRY */ |
347 | /* ===================================== */ |
348 | |
349 | #elif defined(_MSC_VER) |
350 | # if (_MSC_VER >= 1800) |
351 | # include <inttypes.h> |
352 | # define CURL_TYPEOF_CURL_OFF_T __int64 |
353 | # define CURL_FORMAT_CURL_OFF_T PRId64 |
354 | # define CURL_FORMAT_CURL_OFF_TU PRIu64 |
355 | # define CURL_SUFFIX_CURL_OFF_T i64 |
356 | # define CURL_SUFFIX_CURL_OFF_TU ui64 |
357 | # elif (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64) |
358 | # define CURL_TYPEOF_CURL_OFF_T __int64 |
359 | # define CURL_FORMAT_CURL_OFF_T "I64d" |
360 | # define CURL_FORMAT_CURL_OFF_TU "I64u" |
361 | # define CURL_SUFFIX_CURL_OFF_T i64 |
362 | # define CURL_SUFFIX_CURL_OFF_TU ui64 |
363 | # else |
364 | # define CURL_TYPEOF_CURL_OFF_T long |
365 | # define CURL_FORMAT_CURL_OFF_T "ld" |
366 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
367 | # define CURL_SUFFIX_CURL_OFF_T L |
368 | # define CURL_SUFFIX_CURL_OFF_TU UL |
369 | # endif |
370 | # define CURL_TYPEOF_CURL_SOCKLEN_T int |
371 | |
372 | /* ===================================== */ |
373 | /* KEEP GENERIC GCC THE LAST ENTRY */ |
374 | /* ===================================== */ |
375 | |
376 | #elif defined(__GNUC__) && !defined(_SCO_DS) |
377 | # if !defined(__LP64__) && \ |
378 | (defined(__ILP32__) || defined(__i386__) || defined(__hppa__) || \ |
379 | defined(__ppc__) || defined(__powerpc__) || defined(__arm__) || \ |
380 | defined(__sparc__) || defined(__mips__) || defined(__sh__) || \ |
381 | defined(__XTENSA__) || \ |
382 | (defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 4) || \ |
383 | (defined(__LONG_MAX__) && __LONG_MAX__ == 2147483647L)) |
384 | # define CURL_TYPEOF_CURL_OFF_T long long |
385 | # define CURL_FORMAT_CURL_OFF_T "lld" |
386 | # define CURL_FORMAT_CURL_OFF_TU "llu" |
387 | # define CURL_SUFFIX_CURL_OFF_T LL |
388 | # define CURL_SUFFIX_CURL_OFF_TU ULL |
389 | # elif defined(__LP64__) || \ |
390 | defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__) || \ |
391 | defined(__e2k__) || \ |
392 | (defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 8) || \ |
393 | (defined(__LONG_MAX__) && __LONG_MAX__ == 9223372036854775807L) |
394 | # define CURL_TYPEOF_CURL_OFF_T long |
395 | # define CURL_FORMAT_CURL_OFF_T "ld" |
396 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
397 | # define CURL_SUFFIX_CURL_OFF_T L |
398 | # define CURL_SUFFIX_CURL_OFF_TU UL |
399 | # endif |
400 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t |
401 | # define CURL_PULL_SYS_TYPES_H 1 |
402 | # define CURL_PULL_SYS_SOCKET_H 1 |
403 | |
404 | #else |
405 | /* generic "safe guess" on old 32 bit style */ |
406 | # define CURL_TYPEOF_CURL_OFF_T long |
407 | # define CURL_FORMAT_CURL_OFF_T "ld" |
408 | # define CURL_FORMAT_CURL_OFF_TU "lu" |
409 | # define CURL_SUFFIX_CURL_OFF_T L |
410 | # define CURL_SUFFIX_CURL_OFF_TU UL |
411 | # define CURL_TYPEOF_CURL_SOCKLEN_T int |
412 | #endif |
413 | |
414 | #ifdef _AIX |
415 | /* AIX needs <sys/poll.h> */ |
416 | #define CURL_PULL_SYS_POLL_H |
417 | #endif |
418 | |
419 | /* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */ |
420 | /* sys/types.h is required here to properly make type definitions below. */ |
421 | #ifdef CURL_PULL_SYS_TYPES_H |
422 | # include <sys/types.h> |
423 | #endif |
424 | |
425 | /* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */ |
426 | /* sys/socket.h is required here to properly make type definitions below. */ |
427 | #ifdef CURL_PULL_SYS_SOCKET_H |
428 | # include <sys/socket.h> |
429 | #endif |
430 | |
431 | /* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file */ |
432 | /* sys/poll.h is required here to properly make type definitions below. */ |
433 | #ifdef CURL_PULL_SYS_POLL_H |
434 | # include <sys/poll.h> |
435 | #endif |
436 | |
437 | /* Data type definition of curl_socklen_t. */ |
438 | #ifdef CURL_TYPEOF_CURL_SOCKLEN_T |
439 | typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t; |
440 | #endif |
441 | |
442 | /* Data type definition of curl_off_t. */ |
443 | |
444 | #ifdef CURL_TYPEOF_CURL_OFF_T |
445 | typedef CURL_TYPEOF_CURL_OFF_T curl_off_t; |
446 | #endif |
447 | |
448 | /* |
449 | * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow |
450 | * these to be visible and exported by the external libcurl interface API, |
451 | * while also making them visible to the library internals, simply including |
452 | * curl_setup.h, without actually needing to include curl.h internally. |
453 | * If some day this section would grow big enough, all this should be moved |
454 | * to its own header file. |
455 | */ |
456 | |
457 | /* |
458 | * Figure out if we can use the ## preprocessor operator, which is supported |
459 | * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__ |
460 | * or __cplusplus so we need to carefully check for them too. |
461 | */ |
462 | |
463 | #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \ |
464 | defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \ |
465 | defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \ |
466 | defined(__ILEC400__) |
467 | /* This compiler is believed to have an ISO compatible preprocessor */ |
468 | #define CURL_ISOCPP |
469 | #else |
470 | /* This compiler is believed NOT to have an ISO compatible preprocessor */ |
471 | #undef CURL_ISOCPP |
472 | #endif |
473 | |
474 | /* |
475 | * Macros for minimum-width signed and unsigned curl_off_t integer constants. |
476 | */ |
477 | |
478 | #if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551) |
479 | # define CURLINC_OFF_T_C_HLPR2(x) x |
480 | # define CURLINC_OFF_T_C_HLPR1(x) CURLINC_OFF_T_C_HLPR2(x) |
481 | # define CURL_OFF_T_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \ |
482 | CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T) |
483 | # define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \ |
484 | CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU) |
485 | #else |
486 | # ifdef CURL_ISOCPP |
487 | # define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix |
488 | # else |
489 | # define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix |
490 | # endif |
491 | # define CURLINC_OFF_T_C_HLPR1(Val,Suffix) CURLINC_OFF_T_C_HLPR2(Val,Suffix) |
492 | # define CURL_OFF_T_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T) |
493 | # define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU) |
494 | #endif |
495 | |
496 | #endif /* CURLINC_SYSTEM_H */ |
497 | |