• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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(__SYMBIAN32__)
145 #  if defined(__EABI__) /* Treat all ARM compilers equally */
146 #    define CURL_TYPEOF_CURL_OFF_T     long long
147 #    define CURL_FORMAT_CURL_OFF_T     "lld"
148 #    define CURL_FORMAT_CURL_OFF_TU    "llu"
149 #    define CURL_SUFFIX_CURL_OFF_T     LL
150 #    define CURL_SUFFIX_CURL_OFF_TU    ULL
151 #  elif defined(__CW32__)
152 #    pragma longlong on
153 #    define CURL_TYPEOF_CURL_OFF_T     long long
154 #    define CURL_FORMAT_CURL_OFF_T     "lld"
155 #    define CURL_FORMAT_CURL_OFF_TU    "llu"
156 #    define CURL_SUFFIX_CURL_OFF_T     LL
157 #    define CURL_SUFFIX_CURL_OFF_TU    ULL
158 #  elif defined(__VC32__)
159 #    define CURL_TYPEOF_CURL_OFF_T     __int64
160 #    define CURL_FORMAT_CURL_OFF_T     "lld"
161 #    define CURL_FORMAT_CURL_OFF_TU    "llu"
162 #    define CURL_SUFFIX_CURL_OFF_T     LL
163 #    define CURL_SUFFIX_CURL_OFF_TU    ULL
164 #  endif
165 #  define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
166 
167 #elif defined(macintosh)
168 #  include <ConditionalMacros.h>
169 #  if TYPE_LONGLONG
170 #    define CURL_TYPEOF_CURL_OFF_T     long long
171 #    define CURL_FORMAT_CURL_OFF_T     "lld"
172 #    define CURL_FORMAT_CURL_OFF_TU    "llu"
173 #    define CURL_SUFFIX_CURL_OFF_T     LL
174 #    define CURL_SUFFIX_CURL_OFF_TU    ULL
175 #  else
176 #    define CURL_TYPEOF_CURL_OFF_T     long
177 #    define CURL_FORMAT_CURL_OFF_T     "ld"
178 #    define CURL_FORMAT_CURL_OFF_TU    "lu"
179 #    define CURL_SUFFIX_CURL_OFF_T     L
180 #    define CURL_SUFFIX_CURL_OFF_TU    UL
181 #  endif
182 #  define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
183 
184 #elif defined(__TANDEM)
185 # if ! defined(__LP64)
186    /* Required for 32-bit NonStop builds only. */
187 #  define CURL_TYPEOF_CURL_OFF_T     long long
188 #  define CURL_FORMAT_CURL_OFF_T     "lld"
189 #  define CURL_FORMAT_CURL_OFF_TU    "llu"
190 #  define CURL_SUFFIX_CURL_OFF_T     LL
191 #  define CURL_SUFFIX_CURL_OFF_TU    ULL
192 #  define CURL_TYPEOF_CURL_SOCKLEN_T int
193 # endif
194 
195 #elif defined(_WIN32_WCE)
196 #  define CURL_TYPEOF_CURL_OFF_T     __int64
197 #  define CURL_FORMAT_CURL_OFF_T     "I64d"
198 #  define CURL_FORMAT_CURL_OFF_TU    "I64u"
199 #  define CURL_SUFFIX_CURL_OFF_T     i64
200 #  define CURL_SUFFIX_CURL_OFF_TU    ui64
201 #  define CURL_TYPEOF_CURL_SOCKLEN_T int
202 
203 #elif defined(__MINGW32__)
204 #  define CURL_TYPEOF_CURL_OFF_T     long long
205 #  define CURL_FORMAT_CURL_OFF_T     "I64d"
206 #  define CURL_FORMAT_CURL_OFF_TU    "I64u"
207 #  define CURL_SUFFIX_CURL_OFF_T     LL
208 #  define CURL_SUFFIX_CURL_OFF_TU    ULL
209 #  define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
210 #  define CURL_PULL_SYS_TYPES_H      1
211 #  define CURL_PULL_WS2TCPIP_H       1
212 
213 #elif defined(__VMS)
214 #  if defined(__VAX)
215 #    define CURL_TYPEOF_CURL_OFF_T     long
216 #    define CURL_FORMAT_CURL_OFF_T     "ld"
217 #    define CURL_FORMAT_CURL_OFF_TU    "lu"
218 #    define CURL_SUFFIX_CURL_OFF_T     L
219 #    define CURL_SUFFIX_CURL_OFF_TU    UL
220 #  else
221 #    define CURL_TYPEOF_CURL_OFF_T     long long
222 #    define CURL_FORMAT_CURL_OFF_T     "lld"
223 #    define CURL_FORMAT_CURL_OFF_TU    "llu"
224 #    define CURL_SUFFIX_CURL_OFF_T     LL
225 #    define CURL_SUFFIX_CURL_OFF_TU    ULL
226 #  endif
227 #  define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
228 
229 #elif defined(__OS400__)
230 #  define CURL_TYPEOF_CURL_OFF_T     long long
231 #  define CURL_FORMAT_CURL_OFF_T     "lld"
232 #  define CURL_FORMAT_CURL_OFF_TU    "llu"
233 #  define CURL_SUFFIX_CURL_OFF_T     LL
234 #  define CURL_SUFFIX_CURL_OFF_TU    ULL
235 #  define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
236 #  define CURL_PULL_SYS_TYPES_H      1
237 #  define CURL_PULL_SYS_SOCKET_H     1
238 
239 #elif defined(__MVS__)
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 
263 #elif defined(__370__)
264 #  if defined(__IBMC__) || defined(__IBMCPP__)
265 #    if defined(_ILP32)
266 #    elif defined(_LP64)
267 #    endif
268 #    if defined(_LONG_LONG)
269 #      define CURL_TYPEOF_CURL_OFF_T     long long
270 #      define CURL_FORMAT_CURL_OFF_T     "lld"
271 #      define CURL_FORMAT_CURL_OFF_TU    "llu"
272 #      define CURL_SUFFIX_CURL_OFF_T     LL
273 #      define CURL_SUFFIX_CURL_OFF_TU    ULL
274 #    elif defined(_LP64)
275 #      define CURL_TYPEOF_CURL_OFF_T     long
276 #      define CURL_FORMAT_CURL_OFF_T     "ld"
277 #      define CURL_FORMAT_CURL_OFF_TU    "lu"
278 #      define CURL_SUFFIX_CURL_OFF_T     L
279 #      define CURL_SUFFIX_CURL_OFF_TU    UL
280 #    else
281 #      define CURL_TYPEOF_CURL_OFF_T     long
282 #      define CURL_FORMAT_CURL_OFF_T     "ld"
283 #      define CURL_FORMAT_CURL_OFF_TU    "lu"
284 #      define CURL_SUFFIX_CURL_OFF_T     L
285 #      define CURL_SUFFIX_CURL_OFF_TU    UL
286 #    endif
287 #    define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
288 #    define CURL_PULL_SYS_TYPES_H      1
289 #    define CURL_PULL_SYS_SOCKET_H     1
290 #  endif
291 
292 #elif defined(TPF)
293 #  define CURL_TYPEOF_CURL_OFF_T     long
294 #  define CURL_FORMAT_CURL_OFF_T     "ld"
295 #  define CURL_FORMAT_CURL_OFF_TU    "lu"
296 #  define CURL_SUFFIX_CURL_OFF_T     L
297 #  define CURL_SUFFIX_CURL_OFF_TU    UL
298 #  define CURL_TYPEOF_CURL_SOCKLEN_T int
299 
300 #elif defined(__TINYC__) /* also known as tcc */
301 #  define CURL_TYPEOF_CURL_OFF_T     long long
302 #  define CURL_FORMAT_CURL_OFF_T     "lld"
303 #  define CURL_FORMAT_CURL_OFF_TU    "llu"
304 #  define CURL_SUFFIX_CURL_OFF_T     LL
305 #  define CURL_SUFFIX_CURL_OFF_TU    ULL
306 #  define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
307 #  define CURL_PULL_SYS_TYPES_H      1
308 #  define CURL_PULL_SYS_SOCKET_H     1
309 
310 #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Oracle Solaris Studio */
311 #  if !defined(__LP64) && (defined(__ILP32) ||                          \
312                            defined(__i386) ||                           \
313                            defined(__sparcv8) ||                        \
314                            defined(__sparcv8plus))
315 #    define CURL_TYPEOF_CURL_OFF_T     long long
316 #    define CURL_FORMAT_CURL_OFF_T     "lld"
317 #    define CURL_FORMAT_CURL_OFF_TU    "llu"
318 #    define CURL_SUFFIX_CURL_OFF_T     LL
319 #    define CURL_SUFFIX_CURL_OFF_TU    ULL
320 #  elif defined(__LP64) || \
321         defined(__amd64) || defined(__sparcv9)
322 #    define CURL_TYPEOF_CURL_OFF_T     long
323 #    define CURL_FORMAT_CURL_OFF_T     "ld"
324 #    define CURL_FORMAT_CURL_OFF_TU    "lu"
325 #    define CURL_SUFFIX_CURL_OFF_T     L
326 #    define CURL_SUFFIX_CURL_OFF_TU    UL
327 #  endif
328 #  define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
329 #  define CURL_PULL_SYS_TYPES_H      1
330 #  define CURL_PULL_SYS_SOCKET_H     1
331 
332 #elif defined(__xlc__) /* IBM xlc compiler */
333 #  if !defined(_LP64)
334 #    define CURL_TYPEOF_CURL_OFF_T     long long
335 #    define CURL_FORMAT_CURL_OFF_T     "lld"
336 #    define CURL_FORMAT_CURL_OFF_TU    "llu"
337 #    define CURL_SUFFIX_CURL_OFF_T     LL
338 #    define CURL_SUFFIX_CURL_OFF_TU    ULL
339 #  else
340 #    define CURL_TYPEOF_CURL_OFF_T     long
341 #    define CURL_FORMAT_CURL_OFF_T     "ld"
342 #    define CURL_FORMAT_CURL_OFF_TU    "lu"
343 #    define CURL_SUFFIX_CURL_OFF_T     L
344 #    define CURL_SUFFIX_CURL_OFF_TU    UL
345 #  endif
346 #  define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
347 #  define CURL_PULL_SYS_TYPES_H      1
348 #  define CURL_PULL_SYS_SOCKET_H     1
349 
350 #elif defined(__hpux) /* HP aCC compiler */
351 #  if !defined(_LP64)
352 #    define CURL_TYPEOF_CURL_OFF_T     long long
353 #    define CURL_FORMAT_CURL_OFF_T     "lld"
354 #    define CURL_FORMAT_CURL_OFF_TU    "llu"
355 #    define CURL_SUFFIX_CURL_OFF_T     LL
356 #    define CURL_SUFFIX_CURL_OFF_TU    ULL
357 #  else
358 #    define CURL_TYPEOF_CURL_OFF_T     long
359 #    define CURL_FORMAT_CURL_OFF_T     "ld"
360 #    define CURL_FORMAT_CURL_OFF_TU    "lu"
361 #    define CURL_SUFFIX_CURL_OFF_T     L
362 #    define CURL_SUFFIX_CURL_OFF_TU    UL
363 #  endif
364 #  define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
365 #  define CURL_PULL_SYS_TYPES_H      1
366 #  define CURL_PULL_SYS_SOCKET_H     1
367 
368 /* ===================================== */
369 /*    KEEP MSVC THE PENULTIMATE ENTRY    */
370 /* ===================================== */
371 
372 #elif defined(_MSC_VER)
373 #  if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
374 #    define CURL_TYPEOF_CURL_OFF_T     __int64
375 #    define CURL_FORMAT_CURL_OFF_T     "I64d"
376 #    define CURL_FORMAT_CURL_OFF_TU    "I64u"
377 #    define CURL_SUFFIX_CURL_OFF_T     i64
378 #    define CURL_SUFFIX_CURL_OFF_TU    ui64
379 #  else
380 #    define CURL_TYPEOF_CURL_OFF_T     long
381 #    define CURL_FORMAT_CURL_OFF_T     "ld"
382 #    define CURL_FORMAT_CURL_OFF_TU    "lu"
383 #    define CURL_SUFFIX_CURL_OFF_T     L
384 #    define CURL_SUFFIX_CURL_OFF_TU    UL
385 #  endif
386 #  define CURL_TYPEOF_CURL_SOCKLEN_T int
387 
388 /* ===================================== */
389 /*    KEEP GENERIC GCC THE LAST ENTRY    */
390 /* ===================================== */
391 
392 #elif defined(__GNUC__) && !defined(_SCO_DS)
393 #  if !defined(__LP64__) &&                                             \
394   (defined(__ILP32__) || defined(__i386__) || defined(__hppa__) ||      \
395    defined(__ppc__) || defined(__powerpc__) || defined(__arm__) ||      \
396    defined(__sparc__) || defined(__mips__) || defined(__sh__) ||        \
397    defined(__XTENSA__) ||                                               \
398    (defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 4)  ||               \
399    (defined(__LONG_MAX__) && __LONG_MAX__ == 2147483647L))
400 #    define CURL_TYPEOF_CURL_OFF_T     long long
401 #    define CURL_FORMAT_CURL_OFF_T     "lld"
402 #    define CURL_FORMAT_CURL_OFF_TU    "llu"
403 #    define CURL_SUFFIX_CURL_OFF_T     LL
404 #    define CURL_SUFFIX_CURL_OFF_TU    ULL
405 #  elif defined(__LP64__) || \
406         defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__) || \
407         defined(__e2k__) || \
408         (defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 8) || \
409         (defined(__LONG_MAX__) && __LONG_MAX__ == 9223372036854775807L)
410 #    define CURL_TYPEOF_CURL_OFF_T     long
411 #    define CURL_FORMAT_CURL_OFF_T     "ld"
412 #    define CURL_FORMAT_CURL_OFF_TU    "lu"
413 #    define CURL_SUFFIX_CURL_OFF_T     L
414 #    define CURL_SUFFIX_CURL_OFF_TU    UL
415 #  endif
416 #  define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
417 #  define CURL_PULL_SYS_TYPES_H      1
418 #  define CURL_PULL_SYS_SOCKET_H     1
419 
420 #else
421 /* generic "safe guess" on old 32 bit style */
422 # define CURL_TYPEOF_CURL_OFF_T     long
423 # define CURL_FORMAT_CURL_OFF_T     "ld"
424 # define CURL_FORMAT_CURL_OFF_TU    "lu"
425 # define CURL_SUFFIX_CURL_OFF_T     L
426 # define CURL_SUFFIX_CURL_OFF_TU    UL
427 # define CURL_TYPEOF_CURL_SOCKLEN_T int
428 #endif
429 
430 #ifdef _AIX
431 /* AIX needs <sys/poll.h> */
432 #define CURL_PULL_SYS_POLL_H
433 #endif
434 
435 
436 /* CURL_PULL_WS2TCPIP_H is defined above when inclusion of header file  */
437 /* ws2tcpip.h is required here to properly make type definitions below. */
438 #ifdef CURL_PULL_WS2TCPIP_H
439 #  include <winsock2.h>
440 #  include <windows.h>
441 #  include <ws2tcpip.h>
442 #endif
443 
444 /* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file  */
445 /* sys/types.h is required here to properly make type definitions below. */
446 #ifdef CURL_PULL_SYS_TYPES_H
447 #  include <sys/types.h>
448 #endif
449 
450 /* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file  */
451 /* sys/socket.h is required here to properly make type definitions below. */
452 #ifdef CURL_PULL_SYS_SOCKET_H
453 #  include <sys/socket.h>
454 #endif
455 
456 /* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file    */
457 /* sys/poll.h is required here to properly make type definitions below.   */
458 #ifdef CURL_PULL_SYS_POLL_H
459 #  include <sys/poll.h>
460 #endif
461 
462 /* Data type definition of curl_socklen_t. */
463 #ifdef CURL_TYPEOF_CURL_SOCKLEN_T
464   typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
465 #endif
466 
467 /* Data type definition of curl_off_t. */
468 
469 #ifdef CURL_TYPEOF_CURL_OFF_T
470   typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
471 #endif
472 
473 /*
474  * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
475  * these to be visible and exported by the external libcurl interface API,
476  * while also making them visible to the library internals, simply including
477  * curl_setup.h, without actually needing to include curl.h internally.
478  * If some day this section would grow big enough, all this should be moved
479  * to its own header file.
480  */
481 
482 /*
483  * Figure out if we can use the ## preprocessor operator, which is supported
484  * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__
485  * or  __cplusplus so we need to carefully check for them too.
486  */
487 
488 #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
489   defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
490   defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
491   defined(__ILEC400__)
492   /* This compiler is believed to have an ISO compatible preprocessor */
493 #define CURL_ISOCPP
494 #else
495   /* This compiler is believed NOT to have an ISO compatible preprocessor */
496 #undef CURL_ISOCPP
497 #endif
498 
499 /*
500  * Macros for minimum-width signed and unsigned curl_off_t integer constants.
501  */
502 
503 #if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
504 #  define CURLINC_OFF_T_C_HLPR2(x) x
505 #  define CURLINC_OFF_T_C_HLPR1(x) CURLINC_OFF_T_C_HLPR2(x)
506 #  define CURL_OFF_T_C(Val)  CURLINC_OFF_T_C_HLPR1(Val) ## \
507                              CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
508 #  define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \
509                              CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
510 #else
511 #  ifdef CURL_ISOCPP
512 #    define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
513 #  else
514 #    define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
515 #  endif
516 #  define CURLINC_OFF_T_C_HLPR1(Val,Suffix) CURLINC_OFF_T_C_HLPR2(Val,Suffix)
517 #  define CURL_OFF_T_C(Val)  CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
518 #  define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
519 #endif
520 
521 #endif /* CURLINC_SYSTEM_H */
522