summaryrefslogtreecommitdiffstats
path: root/include/curl/system.h
blob: ed3a55c954737970f9058d36e7bf36192136c569 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
#ifndef __CURL_SYSTEM_H
#define __CURL_SYSTEM_H
/***************************************************************************
 *                                  _   _ ____  _
 *  Project                     ___| | | |  _ \| |
 *                             / __| | | | |_) | |
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution. The terms
 * are also available at https://curl.haxx.se/docs/copyright.html.
 *
 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
 * copies of the Software, and permit persons to whom the Software is
 * furnished to do so, under the terms of the COPYING file.
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 * KIND, either express or implied.
 *
 ***************************************************************************/

/*
 * This header is supposed to eventually replace curlbuild.h. This little one
 * is still learning.  During the experimental phase, this header files
 * defines symbols using the prefixes CURLSYS_ or curlsys_. When we feel
 * confident enough, we replace curlbuild.h with this file and rename all
 * prefixes to CURL_ and curl_.
 */

/*
 * Try to keep one section per platform, compiler and architecture, otherwise,
 * if an existing section is reused for a different one and later on the
 * original is adjusted, probably the piggybacking one can be adversely
 * changed.
 *
 * In order to differentiate between platforms/compilers/architectures use
 * only compiler built in predefined preprocessor symbols.
 *
 * curl_off_t
 * ----------
 *
 * For any given platform/compiler curl_off_t must be typedef'ed to a 64-bit
 * wide signed integral data type. The width of this data type must remain
 * constant and independent of any possible large file support settings.
 *
 * As an exception to the above, curl_off_t shall be typedef'ed to a 32-bit
 * wide signed integral data type if there is no 64-bit type.
 *
 * As a general rule, curl_off_t shall not be mapped to off_t. This rule shall
 * only be violated if off_t is the only 64-bit data type available and the
 * size of off_t is independent of large file support settings. Keep your
 * build on the safe side avoiding an off_t gating.  If you have a 64-bit
 * off_t then take for sure that another 64-bit data type exists, dig deeper
 * and you will find it.
 *
 */

#if defined(__DJGPP__) || defined(__GO32__)
#  if defined(__DJGPP__) && (__DJGPP__ > 1)
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     long long
#    define CURLSYS_FORMAT_CURL_OFF_T     "lld"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "llu"
#    define CURLSYS_SIZEOF_CURL_OFF_T     8
#    define CURLSYS_SUFFIX_CURL_OFF_T     LL
#    define CURLSYS_SUFFIX_CURL_OFF_TU    ULL
#  else
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     long
#    define CURLSYS_FORMAT_CURL_OFF_T     "ld"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "lu"
#    define CURLSYS_SIZEOF_CURL_OFF_T     4
#    define CURLSYS_SUFFIX_CURL_OFF_T     L
#    define CURLSYS_SUFFIX_CURL_OFF_TU    UL
#  endif
#  define CURLSYS_TYPEOF_CURL_SOCKLEN_T int
#  define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4

#elif defined(__SALFORDC__)
#  define CURLSYS_SIZEOF_LONG           4
#  define CURLSYS_TYPEOF_CURL_OFF_T     long
#  define CURLSYS_FORMAT_CURL_OFF_T     "ld"
#  define CURLSYS_FORMAT_CURL_OFF_TU    "lu"
#  define CURLSYS_SIZEOF_CURL_OFF_T     4
#  define CURLSYS_SUFFIX_CURL_OFF_T     L
#  define CURLSYS_SUFFIX_CURL_OFF_TU    UL
#  define CURLSYS_TYPEOF_CURL_SOCKLEN_T int
#  define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4

#elif defined(__BORLANDC__)
#  if (__BORLANDC__ < 0x520)
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     long
#    define CURLSYS_FORMAT_CURL_OFF_T     "ld"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "lu"
#    define CURLSYS_SIZEOF_CURL_OFF_T     4
#    define CURLSYS_SUFFIX_CURL_OFF_T     L
#    define CURLSYS_SUFFIX_CURL_OFF_TU    UL
#  else
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     __int64
#    define CURLSYS_FORMAT_CURL_OFF_T     "I64d"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "I64u"
#    define CURLSYS_SIZEOF_CURL_OFF_T     8
#    define CURLSYS_SUFFIX_CURL_OFF_T     i64
#    define CURLSYS_SUFFIX_CURL_OFF_TU    ui64
#  endif
#  define CURLSYS_TYPEOF_CURL_SOCKLEN_T int
#  define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4

#elif defined(__TURBOC__)
#  define CURLSYS_SIZEOF_LONG           4
#  define CURLSYS_TYPEOF_CURL_OFF_T     long
#  define CURLSYS_FORMAT_CURL_OFF_T     "ld"
#  define CURLSYS_FORMAT_CURL_OFF_TU    "lu"
#  define CURLSYS_SIZEOF_CURL_OFF_T     4
#  define CURLSYS_SUFFIX_CURL_OFF_T     L
#  define CURLSYS_SUFFIX_CURL_OFF_TU    UL
#  define CURLSYS_TYPEOF_CURL_SOCKLEN_T int
#  define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4

#elif defined(__WATCOMC__)
#  if defined(__386__)
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     __int64
#    define CURLSYS_FORMAT_CURL_OFF_T     "I64d"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "I64u"
#    define CURLSYS_SIZEOF_CURL_OFF_T     8
#    define CURLSYS_SUFFIX_CURL_OFF_T     i64
#    define CURLSYS_SUFFIX_CURL_OFF_TU    ui64
#  else
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     long
#    define CURLSYS_FORMAT_CURL_OFF_T     "ld"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "lu"
#    define CURLSYS_SIZEOF_CURL_OFF_T     4
#    define CURLSYS_SUFFIX_CURL_OFF_T     L
#    define CURLSYS_SUFFIX_CURL_OFF_TU    UL
#  endif
#  define CURLSYS_TYPEOF_CURL_SOCKLEN_T int
#  define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4

#elif defined(__POCC__)
#  if (__POCC__ < 280)
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     long
#    define CURLSYS_FORMAT_CURL_OFF_T     "ld"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "lu"
#    define CURLSYS_SIZEOF_CURL_OFF_T     4
#    define CURLSYS_SUFFIX_CURL_OFF_T     L
#    define CURLSYS_SUFFIX_CURL_OFF_TU    UL
#  elif defined(_MSC_VER)
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     __int64
#    define CURLSYS_FORMAT_CURL_OFF_T     "I64d"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "I64u"
#    define CURLSYS_SIZEOF_CURL_OFF_T     8
#    define CURLSYS_SUFFIX_CURL_OFF_T     i64
#    define CURLSYS_SUFFIX_CURL_OFF_TU    ui64
#  else
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     long long
#    define CURLSYS_FORMAT_CURL_OFF_T     "lld"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "llu"
#    define CURLSYS_SIZEOF_CURL_OFF_T     8
#    define CURLSYS_SUFFIX_CURL_OFF_T     LL
#    define CURLSYS_SUFFIX_CURL_OFF_TU    ULL
#  endif
#  define CURLSYS_TYPEOF_CURL_SOCKLEN_T int
#  define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4

#elif defined(__LCC__)
#  define CURLSYS_SIZEOF_LONG           4
#  define CURLSYS_TYPEOF_CURL_OFF_T     long
#  define CURLSYS_FORMAT_CURL_OFF_T     "ld"
#  define CURLSYS_FORMAT_CURL_OFF_TU    "lu"
#  define CURLSYS_SIZEOF_CURL_OFF_T     4
#  define CURLSYS_SUFFIX_CURL_OFF_T     L
#  define CURLSYS_SUFFIX_CURL_OFF_TU    UL
#  define CURLSYS_TYPEOF_CURL_SOCKLEN_T int
#  define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4

#elif defined(__SYMBIAN32__)
#  if defined(__EABI__)  /* Treat all ARM compilers equally */
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     long long
#    define CURLSYS_FORMAT_CURL_OFF_T     "lld"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "llu"
#    define CURLSYS_SIZEOF_CURL_OFF_T     8
#    define CURLSYS_SUFFIX_CURL_OFF_T     LL
#    define CURLSYS_SUFFIX_CURL_OFF_TU    ULL
#  elif defined(__CW32__)
#    pragma longlong on
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     long long
#    define CURLSYS_FORMAT_CURL_OFF_T     "lld"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "llu"
#    define CURLSYS_SIZEOF_CURL_OFF_T     8
#    define CURLSYS_SUFFIX_CURL_OFF_T     LL
#    define CURLSYS_SUFFIX_CURL_OFF_TU    ULL
#  elif defined(__VC32__)
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     __int64
#    define CURLSYS_FORMAT_CURL_OFF_T     "lld"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "llu"
#    define CURLSYS_SIZEOF_CURL_OFF_T     8
#    define CURLSYS_SUFFIX_CURL_OFF_T     LL
#    define CURLSYS_SUFFIX_CURL_OFF_TU    ULL
#  endif
#  define CURLSYS_TYPEOF_CURL_SOCKLEN_T unsigned int
#  define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4

#elif defined(__MWERKS__)
#  define CURLSYS_SIZEOF_LONG           4
#  define CURLSYS_TYPEOF_CURL_OFF_T     long long
#  define CURLSYS_FORMAT_CURL_OFF_T     "lld"
#  define CURLSYS_FORMAT_CURL_OFF_TU    "llu"
#  define CURLSYS_SIZEOF_CURL_OFF_T     8
#  define CURLSYS_SUFFIX_CURL_OFF_T     LL
#  define CURLSYS_SUFFIX_CURL_OFF_TU    ULL
#  define CURLSYS_TYPEOF_CURL_SOCKLEN_T int
#  define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4

#elif defined(_WIN32_WCE)
#  define CURLSYS_SIZEOF_LONG           4
#  define CURLSYS_TYPEOF_CURL_OFF_T     __int64
#  define CURLSYS_FORMAT_CURL_OFF_T     "I64d"
#  define CURLSYS_FORMAT_CURL_OFF_TU    "I64u"
#  define CURLSYS_SIZEOF_CURL_OFF_T     8
#  define CURLSYS_SUFFIX_CURL_OFF_T     i64
#  define CURLSYS_SUFFIX_CURL_OFF_TU    ui64
#  define CURLSYS_TYPEOF_CURL_SOCKLEN_T int
#  define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4

#elif defined(__MINGW32__)
#  define CURLSYS_SIZEOF_LONG           4
#  define CURLSYS_TYPEOF_CURL_OFF_T     long long
#  define CURLSYS_FORMAT_CURL_OFF_T     "I64d"
#  define CURLSYS_FORMAT_CURL_OFF_TU    "I64u"
#  define CURLSYS_SIZEOF_CURL_OFF_T     8
#  define CURLSYS_SUFFIX_CURL_OFF_T     LL
#  define CURLSYS_SUFFIX_CURL_OFF_TU    ULL
#  define CURLSYS_TYPEOF_CURL_SOCKLEN_T socklen_t
#  define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4
#  define CURLSYS_PULL_SYS_TYPES_H      1
#  define CURLSYS_PULL_WS2TCPIP_H       1

#elif defined(__VMS)
#  if defined(__VAX)
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     long
#    define CURLSYS_FORMAT_CURL_OFF_T     "ld"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "lu"
#    define CURLSYS_SIZEOF_CURL_OFF_T     4
#    define CURLSYS_SUFFIX_CURL_OFF_T     L
#    define CURLSYS_SUFFIX_CURL_OFF_TU    UL
#  else
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     long long
#    define CURLSYS_FORMAT_CURL_OFF_T     "lld"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "llu"
#    define CURLSYS_SIZEOF_CURL_OFF_T     8
#    define CURLSYS_SUFFIX_CURL_OFF_T     LL
#    define CURLSYS_SUFFIX_CURL_OFF_TU    ULL
#  endif
#  define CURLSYS_TYPEOF_CURL_SOCKLEN_T unsigned int
#  define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4

#elif defined(__OS400__)
#  if defined(__ILEC400__)
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     long long
#    define CURLSYS_FORMAT_CURL_OFF_T     "lld"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "llu"
#    define CURLSYS_SIZEOF_CURL_OFF_T     8
#    define CURLSYS_SUFFIX_CURL_OFF_T     LL
#    define CURLSYS_SUFFIX_CURL_OFF_TU    ULL
#    define CURLSYS_TYPEOF_CURL_SOCKLEN_T socklen_t
#    define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4
#    define CURLSYS_PULL_SYS_TYPES_H      1
#    define CURLSYS_PULL_SYS_SOCKET_H     1
#  endif

#elif defined(__MVS__)
#  if defined(__IBMC__) || defined(__IBMCPP__)
#    if defined(_ILP32)
#      define CURLSYS_SIZEOF_LONG           4
#    elif defined(_LP64)
#      define CURLSYS_SIZEOF_LONG           8
#    endif
#    if defined(_LONG_LONG)
#      define CURLSYS_TYPEOF_CURL_OFF_T     long long
#      define CURLSYS_FORMAT_CURL_OFF_T     "lld"
#      define CURLSYS_FORMAT_CURL_OFF_TU    "llu"
#      define CURLSYS_SIZEOF_CURL_OFF_T     8
#      define CURLSYS_SUFFIX_CURL_OFF_T     LL
#      define CURLSYS_SUFFIX_CURL_OFF_TU    ULL
#    elif defined(_LP64)
#      define CURLSYS_TYPEOF_CURL_OFF_T     long
#      define CURLSYS_FORMAT_CURL_OFF_T     "ld"
#      define CURLSYS_FORMAT_CURL_OFF_TU    "lu"
#      define CURLSYS_SIZEOF_CURL_OFF_T     8
#      define CURLSYS_SUFFIX_CURL_OFF_T     L
#      define CURLSYS_SUFFIX_CURL_OFF_TU    UL
#    else
#      define CURLSYS_TYPEOF_CURL_OFF_T     long
#      define CURLSYS_FORMAT_CURL_OFF_T     "ld"
#      define CURLSYS_FORMAT_CURL_OFF_TU    "lu"
#      define CURLSYS_SIZEOF_CURL_OFF_T     4
#      define CURLSYS_SUFFIX_CURL_OFF_T     L
#      define CURLSYS_SUFFIX_CURL_OFF_TU    UL
#    endif
#    define CURLSYS_TYPEOF_CURL_SOCKLEN_T socklen_t
#    define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4
#    define CURLSYS_PULL_SYS_TYPES_H      1
#    define CURLSYS_PULL_SYS_SOCKET_H     1
#  endif

#elif defined(__370__)
#  if defined(__IBMC__) || defined(__IBMCPP__)
#    if defined(_ILP32)
#      define CURLSYS_SIZEOF_LONG           4
#    elif defined(_LP64)
#      define CURLSYS_SIZEOF_LONG           8
#    endif
#    if defined(_LONG_LONG)
#      define CURLSYS_TYPEOF_CURL_OFF_T     long long
#      define CURLSYS_FORMAT_CURL_OFF_T     "lld"
#      define CURLSYS_FORMAT_CURL_OFF_TU    "llu"
#      define CURLSYS_SIZEOF_CURL_OFF_T     8
#      define CURLSYS_SUFFIX_CURL_OFF_T     LL
#      define CURLSYS_SUFFIX_CURL_OFF_TU    ULL
#    elif defined(_LP64)
#      define CURLSYS_TYPEOF_CURL_OFF_T     long
#      define CURLSYS_FORMAT_CURL_OFF_T     "ld"
#      define CURLSYS_FORMAT_CURL_OFF_TU    "lu"
#      define CURLSYS_SIZEOF_CURL_OFF_T     8
#      define CURLSYS_SUFFIX_CURL_OFF_T     L
#      define CURLSYS_SUFFIX_CURL_OFF_TU    UL
#    else
#      define CURLSYS_TYPEOF_CURL_OFF_T     long
#      define CURLSYS_FORMAT_CURL_OFF_T     "ld"
#      define CURLSYS_FORMAT_CURL_OFF_TU    "lu"
#      define CURLSYS_SIZEOF_CURL_OFF_T     4
#      define CURLSYS_SUFFIX_CURL_OFF_T     L
#      define CURLSYS_SUFFIX_CURL_OFF_TU    UL
#    endif
#    define CURLSYS_TYPEOF_CURL_SOCKLEN_T socklen_t
#    define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4
#    define CURLSYS_PULL_SYS_TYPES_H      1
#    define CURLSYS_PULL_SYS_SOCKET_H     1
#  endif

#elif defined(TPF)
#  define CURLSYS_SIZEOF_LONG           8
#  define CURLSYS_TYPEOF_CURL_OFF_T     long
#  define CURLSYS_FORMAT_CURL_OFF_T     "ld"
#  define CURLSYS_FORMAT_CURL_OFF_TU    "lu"
#  define CURLSYS_SIZEOF_CURL_OFF_T     8
#  define CURLSYS_SUFFIX_CURL_OFF_T     L
#  define CURLSYS_SUFFIX_CURL_OFF_TU    UL
#  define CURLSYS_TYPEOF_CURL_SOCKLEN_T int
#  define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4

#elif defined(__TINYC__) /* also known as tcc */

#  define CURLSYS_SIZEOF_LONG           4
#  define CURLSYS_TYPEOF_CURL_OFF_T     long long
#  define CURLSYS_FORMAT_CURL_OFF_T     "lld"
#  define CURLSYS_FORMAT_CURL_OFF_TU    "llu"
#  define CURLSYS_SIZEOF_CURL_OFF_T     8
#  define CURLSYS_SUFFIX_CURL_OFF_T     LL
#  define CURLSYS_SUFFIX_CURL_OFF_TU    ULL
#  define CURLSYS_TYPEOF_CURL_SOCKLEN_T socklen_t
#  define CURLSYS_PULL_SYS_TYPES_H      1
#  define CURLSYS_PULL_SYS_SOCKET_H     1

/* ===================================== */
/*    KEEP MSVC THE PENULTIMATE ENTRY    */
/* ===================================== */

#elif defined(_MSC_VER)
#  if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     __int64
#    define CURLSYS_FORMAT_CURL_OFF_T     "I64d"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "I64u"
#    define CURLSYS_SIZEOF_CURL_OFF_T     8
#    define CURLSYS_SUFFIX_CURL_OFF_T     i64
#    define CURLSYS_SUFFIX_CURL_OFF_TU    ui64
#  else
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     long
#    define CURLSYS_FORMAT_CURL_OFF_T     "ld"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "lu"
#    define CURLSYS_SIZEOF_CURL_OFF_T     4
#    define CURLSYS_SUFFIX_CURL_OFF_T     L
#    define CURLSYS_SUFFIX_CURL_OFF_TU    UL
#  endif
#  define CURLSYS_TYPEOF_CURL_SOCKLEN_T int
#  define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4

/* ===================================== */
/*    KEEP GENERIC GCC THE LAST ENTRY    */
/* ===================================== */

#elif defined(__GNUC__)
#  if !defined(__LP64__) && (defined(__ILP32__) || \
      defined(__i386__) || defined(__ppc__) || defined(__arm__) || \
      defined(__sparc__) || defined(__mips__) || defined(__sh__))
#    define CURLSYS_SIZEOF_LONG           4
#    define CURLSYS_TYPEOF_CURL_OFF_T     long long
#    define CURLSYS_FORMAT_CURL_OFF_T     "lld"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "llu"
#    define CURLSYS_SIZEOF_CURL_OFF_T     8
#    define CURLSYS_SUFFIX_CURL_OFF_T     LL
#    define CURLSYS_SUFFIX_CURL_OFF_TU    ULL
#  elif defined(__LP64__) || \
        defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__)
#    define CURLSYS_SIZEOF_LONG           8
#    define CURLSYS_TYPEOF_CURL_OFF_T     long
#    define CURLSYS_FORMAT_CURL_OFF_T     "ld"
#    define CURLSYS_FORMAT_CURL_OFF_TU    "lu"
#    define CURLSYS_SIZEOF_CURL_OFF_T     8
#    define CURLSYS_SUFFIX_CURL_OFF_T     L
#    define CURLSYS_SUFFIX_CURL_OFF_TU    UL
#  endif
#  define CURLSYS_TYPEOF_CURL_SOCKLEN_T socklen_t
#  define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4
#  define CURLSYS_PULL_SYS_TYPES_H      1
#  define CURLSYS_PULL_SYS_SOCKET_H     1

#else
/* generic "safe guess" on old 32 bit style */
# define CURLSYS_SIZEOF_LONG 4
# define CURLSYS_SIZEOF_CURL_SOCKLEN_T 4
# define CURLSYS_SIZEOF_CURL_OFF_T 4
# define CURLSYS_TYPEOF_CURL_OFF_T     long
# define CURLSYS_FORMAT_CURL_OFF_T     "ld"
# define CURLSYS_FORMAT_CURL_OFF_TU    "lu"
# define CURLSYS_SUFFIX_CURL_OFF_T     L
# define CURLSYS_SUFFIX_CURL_OFF_TU    UL
# define CURLSYS_TYPEOF_CURL_SOCKLEN_T int
#endif

/* CURLSYS_PULL_WS2TCPIP_H is defined above when inclusion of header file  */
/* ws2tcpip.h is required here to properly make type definitions below. */
#ifdef CURLSYS_PULL_WS2TCPIP_H
#  ifndef WIN32_LEAN_AND_MEAN
#    define WIN32_LEAN_AND_MEAN
#  endif
#  include <windows.h>
#  include <winsock2.h>
#  include <ws2tcpip.h>
#endif

/* CURLSYS_PULL_SYS_TYPES_H is defined above when inclusion of header file  */
/* sys/types.h is required here to properly make type definitions below. */
#ifdef CURLSYS_PULL_SYS_TYPES_H
#  include <sys/types.h>
#endif

/* CURLSYS_PULL_SYS_SOCKET_H is defined above when inclusion of header file  */
/* sys/socket.h is required here to properly make type definitions below. */
#ifdef CURLSYS_PULL_SYS_SOCKET_H
#  include <sys/socket.h>
#endif

/* Data type definition of curl_socklen_t. */
#ifdef CURLSYS_TYPEOF_CURL_SOCKLEN_T
  typedef CURLSYS_TYPEOF_CURL_SOCKLEN_T curlsys_socklen_t;
#endif

/* Data type definition of curl_off_t. */

#ifdef CURLSYS_TYPEOF_CURL_OFF_T
  typedef CURLSYS_TYPEOF_CURL_OFF_T curlsys_off_t;
#endif

#endif /* __CURL_SYSTEM_H */