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