~ubuntu-branches/ubuntu/lucid/curl/lucid-201101212007

« back to all changes in this revision

Viewing changes to lib/setup.h

  • Committer: Bazaar Package Importer
  • Author(s): Domenico Andreoli
  • Date: 2009-11-05 10:11:57 UTC
  • mto: (3.3.3 squeeze)
  • mto: This revision was merged to the branch mainline in revision 41.
  • Revision ID: james.westby@ubuntu.com-20091105101157-bj4sosg9l00k9c08
Tags: upstream-7.19.7
ImportĀ upstreamĀ versionĀ 7.19.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 *                            | (__| |_| |  _ <| |___
8
8
 *                             \___|\___/|_| \_\_____|
9
9
 *
10
 
 * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
 
10
 * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
11
11
 *
12
12
 * This software is licensed as described in the file COPYING, which
13
13
 * you should have received as part of this distribution. The terms
20
20
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21
21
 * KIND, either express or implied.
22
22
 *
23
 
 * $Id: setup.h,v 1.164 2009-05-01 12:39:40 yangtse Exp $
 
23
 * $Id: setup.h,v 1.171 2009-10-27 16:38:42 yangtse Exp $
24
24
 ***************************************************************************/
25
25
 
26
26
/*
37
37
 */
38
38
 
39
39
#ifdef HAVE_CONFIG_H
40
 
#include "config.h"
41
 
#else
 
40
 
 
41
#include "curl_config.h"
 
42
 
 
43
#else /* HAVE_CONFIG_H */
42
44
 
43
45
#ifdef _WIN32_WCE
44
 
#include "config-win32ce.h"
 
46
#  include "config-win32ce.h"
45
47
#else
46
 
#ifdef WIN32
47
 
#include "config-win32.h"
48
 
#endif
 
48
#  ifdef WIN32
 
49
#    include "config-win32.h"
 
50
#  endif
49
51
#endif
50
52
 
51
53
#if defined(macintosh) && defined(__MRC__)
53
55
#endif
54
56
 
55
57
#ifdef __AMIGA__
56
 
#include "amigaos.h"
 
58
#  include "amigaos.h"
57
59
#endif
58
60
 
59
61
#ifdef __SYMBIAN32__
60
 
#include "config-symbian.h"
 
62
#  include "config-symbian.h"
61
63
#endif
62
64
 
63
65
#ifdef __OS400__
68
70
#  include "config-tpf.h"
69
71
#endif
70
72
 
 
73
#ifdef __VXWORKS__
 
74
#  include "config-vxworks.h"
 
75
#endif
 
76
 
71
77
#endif /* HAVE_CONFIG_H */
72
78
 
73
79
/* ================================================================ */
74
80
/* Definition of preprocessor macros/symbols which modify compiler  */
75
 
/* behaviour or generated code characteristics must be done here,   */
 
81
/* behavior or generated code characteristics must be done here,   */
76
82
/* as appropriate, before any system header file is included. It is */
77
83
/* also possible to have them defined in the config file included   */
78
84
/* before this point. As a result of all this we frown inclusion of */
169
175
 
170
176
/*
171
177
 * Include header files for windows builds before redefining anything.
172
 
 * Use this preproessor block only to include or exclude windows.h,
 
178
 * Use this preprocessor block only to include or exclude windows.h,
173
179
 * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
174
 
 * to any other further and independant block.  Under Cygwin things work
 
180
 * to any other further and independent block.  Under Cygwin things work
175
181
 * just as under linux (e.g. <sys/socket.h>) and the winsock headers should
176
182
 * never be included when __CYGWIN__ is defined.  configure script takes
177
183
 * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
230
236
#  define select(a,b,c,d,e) tpf_select_libcurl(a,b,c,d,e)
231
237
#endif
232
238
 
 
239
#ifdef __VXWORKS__
 
240
#  include <sockLib.h>    /* for generic BSD socket functions */
 
241
#  include <ioLib.h>      /* for basic I/O interface functions */
 
242
#endif
 
243
 
233
244
#include <stdio.h>
234
245
#ifdef HAVE_ASSERT_H
235
246
#include <assert.h>
244
255
#include <curl/stdcheaders.h>
245
256
#endif
246
257
 
247
 
/*
248
 
 * PellesC kludge section (yikes);
249
 
 *  - It has 'ssize_t', but it is in <unistd.h>. The way the headers
250
 
 *    on Win32 are included, forces me to include this header here.
251
 
 *  - sys_nerr, EINTR is missing in v4.0 or older.
252
 
 */
253
258
#ifdef __POCC__
254
 
  #include <sys/types.h>
255
 
  #include <unistd.h>
256
 
  #if (__POCC__ <= 400)
257
 
  #define sys_nerr EILSEQ  /* for strerror.c */
258
 
  #define EINTR    -1      /* for select.c */
259
 
  #endif
 
259
#  include <sys/types.h>
 
260
#  include <unistd.h>
 
261
#  define sys_nerr EILSEQ
260
262
#endif
261
263
 
262
264
/*
282
284
#  define fstat(fdes,stp)            _fstati64(fdes, stp)
283
285
#  define stat(fname,stp)            _stati64(fname, stp)
284
286
#  define struct_stat                struct _stati64
 
287
#  define LSEEK_ERROR                (__int64)-1
285
288
#endif
286
289
 
287
290
/*
296
299
#  define fstat(fdes,stp)            _fstat(fdes, stp)
297
300
#  define stat(fname,stp)            _stat(fname, stp)
298
301
#  define struct_stat                struct _stat
 
302
#  define LSEEK_ERROR                (long)-1
299
303
#endif
300
304
 
301
305
#ifndef struct_stat
302
306
#  define struct_stat struct stat
303
307
#endif
304
308
 
 
309
#ifndef LSEEK_ERROR
 
310
#  define LSEEK_ERROR (off_t)-1
 
311
#endif
 
312
 
305
313
/*
306
314
 * Default sizeof(off_t) in case it hasn't been defined in config file.
307
315
 */
330
338
#endif
331
339
 
332
340
/* Below we define some functions. They should
333
 
   1. close a socket
334
341
 
335
342
   4. set the SIGALRM signal timeout
336
343
   5. set dir/file naming defines
338
345
 
339
346
#ifdef WIN32
340
347
 
341
 
#  if !defined(__CYGWIN__)
342
 
#    define sclose(x) closesocket(x)
343
 
#  else
344
 
#    define sclose(x) close(x)
345
 
#  endif
346
 
 
347
348
#  define DIR_CHAR      "\\"
348
349
#  define DOT_CHAR      "_"
349
350
 
352
353
#  ifdef MSDOS  /* Watt-32 */
353
354
 
354
355
#    include <sys/ioctl.h>
355
 
#    define sclose(x)         close_s(x)
356
356
#    define select(n,r,w,x,t) select_s(n,r,w,x,t)
357
357
#    define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z))
358
358
#    include <tcp.h>
363
363
#      undef byte
364
364
#    endif
365
365
 
366
 
#  else /* MSDOS */
367
 
 
368
 
#    ifdef __BEOS__
369
 
#      define sclose(x) closesocket(x)
370
 
#    else /* __BEOS__ */
371
 
#      define sclose(x) close(x)
372
 
#    endif /* __BEOS__ */
373
 
 
374
366
#  endif /* MSDOS */
375
367
 
376
 
#  ifdef _AMIGASF
377
 
#    undef sclose
378
 
#    define sclose(x) CloseSocket(x)
379
 
#  endif
380
 
 
381
368
#  ifdef __minix
382
369
     /* Minix 3 versions up to at least 3.1.3 are missing these prototypes */
383
370
     extern char * strtok_r(char *s, const char *delim, char **last);
418
405
#endif
419
406
 
420
407
/*
 
408
 * When using WINSOCK, TELNET protocol requires WINSOCK2 API.
 
409
 */
 
410
 
 
411
#if defined(USE_WINSOCK) && (USE_WINSOCK != 2)
 
412
#  define CURL_DISABLE_TELNET 1
 
413
#endif
 
414
 
 
415
/*
421
416
 * msvc 6.0 does not have struct sockaddr_storage and
422
417
 * does not define IPPROTO_ESP in winsock2.h. But both
423
418
 * are available if PSDK is properly installed.
424
419
 */
425
420
 
426
 
#ifdef _MSC_VER
427
 
#if !defined(HAVE_WINSOCK2_H) || ((_MSC_VER < 1300) && !defined(IPPROTO_ESP))
428
 
#undef HAVE_STRUCT_SOCKADDR_STORAGE
429
 
#endif
 
421
#if defined(_MSC_VER) && !defined(__POCC__)
 
422
#  if !defined(HAVE_WINSOCK2_H) || ((_MSC_VER < 1300) && !defined(IPPROTO_ESP))
 
423
#    undef HAVE_STRUCT_SOCKADDR_STORAGE
 
424
#  endif
 
425
#endif
 
426
 
 
427
/*
 
428
 * msvc 6.0 requires PSDK in order to have INET6_ADDRSTRLEN
 
429
 * defined in ws2tcpip.h as well as to provide IPv6 support.
 
430
 */
 
431
 
 
432
#if defined(_MSC_VER) && !defined(__POCC__)
 
433
#  if !defined(HAVE_WS2TCPIP_H) || ((_MSC_VER < 1300) && !defined(INET6_ADDRSTRLEN))
 
434
#    undef HAVE_FREEADDRINFO
 
435
#    undef HAVE_GETADDRINFO
 
436
#    undef HAVE_GETNAMEINFO
 
437
#    undef ENABLE_IPV6
 
438
#  endif
 
439
#endif
 
440
 
 
441
/*
 
442
 * Intentionally fail to build when using msvc 6.0 without PSDK installed.
 
443
 * The brave of heart can circumvent this, defining ALLOW_MSVC6_WITHOUT_PSDK
 
444
 * in lib/config-win32.h although absolutely discouraged and unsupported.
 
445
 */
 
446
 
 
447
#if defined(_MSC_VER) && !defined(__POCC__)
 
448
#  if !defined(HAVE_WINDOWS_H) || ((_MSC_VER < 1300) && !defined(_FILETIME_))
 
449
#    if !defined(ALLOW_MSVC6_WITHOUT_PSDK)
 
450
#      error MSVC 6.0 requires 'February 2003 Platform SDK' a.k.a. 'Windows Server 2003 PSDK'
 
451
#    else
 
452
#      define CURL_DISABLE_LDAP 1
 
453
#    endif
 
454
#  endif
430
455
#endif
431
456
 
432
457
#ifdef NETWARE