curl_setup.h
Go to the documentation of this file.
00001 #ifndef HEADER_CURL_SETUP_H
00002 #define HEADER_CURL_SETUP_H
00003 /***************************************************************************
00004  *                                  _   _ ____  _
00005  *  Project                     ___| | | |  _ \| |
00006  *                             / __| | | | |_) | |
00007  *                            | (__| |_| |  _ <| |___
00008  *                             \___|\___/|_| \_\_____|
00009  *
00010  * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
00011  *
00012  * This software is licensed as described in the file COPYING, which
00013  * you should have received as part of this distribution. The terms
00014  * are also available at https://curl.haxx.se/docs/copyright.html.
00015  *
00016  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
00017  * copies of the Software, and permit persons to whom the Software is
00018  * furnished to do so, under the terms of the COPYING file.
00019  *
00020  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
00021  * KIND, either express or implied.
00022  *
00023  ***************************************************************************/
00024 
00025 /*
00026  * Define WIN32 when build target is Win32 API
00027  */
00028 
00029 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) && \
00030     !defined(__SYMBIAN32__)
00031 #define WIN32
00032 #endif
00033 
00034 /*
00035  * Include configuration script results or hand-crafted
00036  * configuration file for platforms which lack config tool.
00037  */
00038 
00039 #ifdef HAVE_CONFIG_H
00040 
00041 #include "curl_config.h"
00042 
00043 #else /* HAVE_CONFIG_H */
00044 
00045 #ifdef _WIN32_WCE
00046 #  include "config-win32ce.h"
00047 #else
00048 #  ifdef WIN32
00049 #    include "config-win32.h"
00050 #  endif
00051 #endif
00052 
00053 #if defined(macintosh) && defined(__MRC__)
00054 #  include "config-mac.h"
00055 #endif
00056 
00057 #ifdef __riscos__
00058 #  include "config-riscos.h"
00059 #endif
00060 
00061 #ifdef __AMIGA__
00062 #  include "config-amigaos.h"
00063 #endif
00064 
00065 #ifdef __SYMBIAN32__
00066 #  include "config-symbian.h"
00067 #endif
00068 
00069 #ifdef __OS400__
00070 #  include "config-os400.h"
00071 #endif
00072 
00073 #ifdef TPF
00074 #  include "config-tpf.h"
00075 #endif
00076 
00077 #ifdef __VXWORKS__
00078 #  include "config-vxworks.h"
00079 #endif
00080 
00081 #endif /* HAVE_CONFIG_H */
00082 
00083 /* ================================================================ */
00084 /* Definition of preprocessor macros/symbols which modify compiler  */
00085 /* behavior or generated code characteristics must be done here,   */
00086 /* as appropriate, before any system header file is included. It is */
00087 /* also possible to have them defined in the config file included   */
00088 /* before this point. As a result of all this we frown inclusion of */
00089 /* system header files in our config files, avoid this at any cost. */
00090 /* ================================================================ */
00091 
00092 /*
00093  * AIX 4.3 and newer needs _THREAD_SAFE defined to build
00094  * proper reentrant code. Others may also need it.
00095  */
00096 
00097 #ifdef NEED_THREAD_SAFE
00098 #  ifndef _THREAD_SAFE
00099 #    define _THREAD_SAFE
00100 #  endif
00101 #endif
00102 
00103 /*
00104  * Tru64 needs _REENTRANT set for a few function prototypes and
00105  * things to appear in the system header files. Unixware needs it
00106  * to build proper reentrant code. Others may also need it.
00107  */
00108 
00109 #ifdef NEED_REENTRANT
00110 #  ifndef _REENTRANT
00111 #    define _REENTRANT
00112 #  endif
00113 #endif
00114 
00115 /* Solaris needs this to get a POSIX-conformant getpwuid_r */
00116 #if defined(sun) || defined(__sun)
00117 #  ifndef _POSIX_PTHREAD_SEMANTICS
00118 #    define _POSIX_PTHREAD_SEMANTICS 1
00119 #  endif
00120 #endif
00121 
00122 /* ================================================================ */
00123 /*  If you need to include a system header file for your platform,  */
00124 /*  please, do it beyond the point further indicated in this file.  */
00125 /* ================================================================ */
00126 
00127 /*
00128  * libcurl's external interface definitions are also used internally,
00129  * and might also include required system header files to define them.
00130  */
00131 
00132 #include <curl/curlbuild.h>
00133 
00134 /*
00135  * Compile time sanity checks must also be done when building the library.
00136  */
00137 
00138 #include <curl/curlrules.h>
00139 
00140 /*
00141  * Ensure that no one is using the old SIZEOF_CURL_OFF_T macro
00142  */
00143 
00144 #ifdef SIZEOF_CURL_OFF_T
00145 #  error "SIZEOF_CURL_OFF_T shall not be defined!"
00146    Error Compilation_aborted_SIZEOF_CURL_OFF_T_shall_not_be_defined
00147 #endif
00148 
00149 /*
00150  * Disable other protocols when http is the only one desired.
00151  */
00152 
00153 #ifdef HTTP_ONLY
00154 #  ifndef CURL_DISABLE_TFTP
00155 #    define CURL_DISABLE_TFTP
00156 #  endif
00157 #  ifndef CURL_DISABLE_FTP
00158 #    define CURL_DISABLE_FTP
00159 #  endif
00160 #  ifndef CURL_DISABLE_LDAP
00161 #    define CURL_DISABLE_LDAP
00162 #  endif
00163 #  ifndef CURL_DISABLE_TELNET
00164 #    define CURL_DISABLE_TELNET
00165 #  endif
00166 #  ifndef CURL_DISABLE_DICT
00167 #    define CURL_DISABLE_DICT
00168 #  endif
00169 #  ifndef CURL_DISABLE_FILE
00170 #    define CURL_DISABLE_FILE
00171 #  endif
00172 #  ifndef CURL_DISABLE_RTSP
00173 #    define CURL_DISABLE_RTSP
00174 #  endif
00175 #  ifndef CURL_DISABLE_POP3
00176 #    define CURL_DISABLE_POP3
00177 #  endif
00178 #  ifndef CURL_DISABLE_IMAP
00179 #    define CURL_DISABLE_IMAP
00180 #  endif
00181 #  ifndef CURL_DISABLE_SMTP
00182 #    define CURL_DISABLE_SMTP
00183 #  endif
00184 #  ifndef CURL_DISABLE_RTMP
00185 #    define CURL_DISABLE_RTMP
00186 #  endif
00187 #  ifndef CURL_DISABLE_GOPHER
00188 #    define CURL_DISABLE_GOPHER
00189 #  endif
00190 #  ifndef CURL_DISABLE_SMB
00191 #    define CURL_DISABLE_SMB
00192 #  endif
00193 #endif
00194 
00195 /*
00196  * When http is disabled rtsp is not supported.
00197  */
00198 
00199 #if defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_RTSP)
00200 #  define CURL_DISABLE_RTSP
00201 #endif
00202 
00203 /* ================================================================ */
00204 /* No system header file shall be included in this file before this */
00205 /* point. The only allowed ones are those included from curlbuild.h */
00206 /* ================================================================ */
00207 
00208 /*
00209  * OS/400 setup file includes some system headers.
00210  */
00211 
00212 #ifdef __OS400__
00213 #  include "setup-os400.h"
00214 #endif
00215 
00216 /*
00217  * VMS setup file includes some system headers.
00218  */
00219 
00220 #ifdef __VMS
00221 #  include "setup-vms.h"
00222 #endif
00223 
00224 /*
00225  * Use getaddrinfo to resolve the IPv4 address literal. If the current network
00226  * interface doesn’t support IPv4, but supports IPv6, NAT64, and DNS64,
00227  * performing this task will result in a synthesized IPv6 address.
00228  */
00229 #ifdef  __APPLE__
00230 #define USE_RESOLVE_ON_IPS 1
00231 #endif
00232 
00233 /*
00234  * Include header files for windows builds before redefining anything.
00235  * Use this preprocessor block only to include or exclude windows.h,
00236  * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
00237  * to any other further and independent block.  Under Cygwin things work
00238  * just as under linux (e.g. <sys/socket.h>) and the winsock headers should
00239  * never be included when __CYGWIN__ is defined.  configure script takes
00240  * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
00241  * neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
00242  */
00243 
00244 #ifdef HAVE_WINDOWS_H
00245 #  if defined(UNICODE) && !defined(_UNICODE)
00246 #    define _UNICODE
00247 #  endif
00248 #  if defined(_UNICODE) && !defined(UNICODE)
00249 #    define UNICODE
00250 #  endif
00251 #  ifndef WIN32_LEAN_AND_MEAN
00252 #    define WIN32_LEAN_AND_MEAN
00253 #  endif
00254 #  include <windows.h>
00255 #  ifdef HAVE_WINSOCK2_H
00256 #    include <winsock2.h>
00257 #    ifdef HAVE_WS2TCPIP_H
00258 #      include <ws2tcpip.h>
00259 #    endif
00260 #  else
00261 #    ifdef HAVE_WINSOCK_H
00262 #      include <winsock.h>
00263 #    endif
00264 #  endif
00265 #  include <tchar.h>
00266 #  ifdef UNICODE
00267      typedef wchar_t *(*curl_wcsdup_callback)(const wchar_t *str);
00268 #  endif
00269 #endif
00270 
00271 /*
00272  * Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else
00273  * define USE_WINSOCK to 1 if we have and use WINSOCK  API, else
00274  * undefine USE_WINSOCK.
00275  */
00276 
00277 #undef USE_WINSOCK
00278 
00279 #ifdef HAVE_WINSOCK2_H
00280 #  define USE_WINSOCK 2
00281 #else
00282 #  ifdef HAVE_WINSOCK_H
00283 #    define USE_WINSOCK 1
00284 #  endif
00285 #endif
00286 
00287 #ifdef USE_LWIPSOCK
00288 #  include <lwip/init.h>
00289 #  include <lwip/sockets.h>
00290 #  include <lwip/netdb.h>
00291 #endif
00292 
00293 #ifdef HAVE_EXTRA_STRICMP_H
00294 #  include <extra/stricmp.h>
00295 #endif
00296 
00297 #ifdef HAVE_EXTRA_STRDUP_H
00298 #  include <extra/strdup.h>
00299 #endif
00300 
00301 #ifdef TPF
00302 #  include <strings.h>    /* for bzero, strcasecmp, and strncasecmp */
00303 #  include <string.h>     /* for strcpy and strlen */
00304 #  include <stdlib.h>     /* for rand and srand */
00305 #  include <sys/socket.h> /* for select and ioctl*/
00306 #  include <netdb.h>      /* for in_addr_t definition */
00307 #  include <tpf/sysapi.h> /* for tpf_process_signals */
00308    /* change which select is used for libcurl */
00309 #  define select(a,b,c,d,e) tpf_select_libcurl(a,b,c,d,e)
00310 #endif
00311 
00312 #ifdef __VXWORKS__
00313 #  include <sockLib.h>    /* for generic BSD socket functions */
00314 #  include <ioLib.h>      /* for basic I/O interface functions */
00315 #endif
00316 
00317 #ifdef __AMIGA__
00318 #  ifndef __ixemul__
00319 #    include <exec/types.h>
00320 #    include <exec/execbase.h>
00321 #    include <proto/exec.h>
00322 #    include <proto/dos.h>
00323 #    define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
00324 #  endif
00325 #endif
00326 
00327 #include <stdio.h>
00328 #ifdef HAVE_ASSERT_H
00329 #include <assert.h>
00330 #endif
00331 
00332 #ifdef __TANDEM /* for nsr-tandem-nsk systems */
00333 #include <floss.h>
00334 #endif
00335 
00336 #ifndef STDC_HEADERS /* no standard C headers! */
00337 #include <curl/stdcheaders.h>
00338 #endif
00339 
00340 #ifdef __POCC__
00341 #  include <sys/types.h>
00342 #  include <unistd.h>
00343 #  define sys_nerr EILSEQ
00344 #endif
00345 
00346 /*
00347  * Salford-C kludge section (mostly borrowed from wxWidgets).
00348  */
00349 #ifdef __SALFORDC__
00350   #pragma suppress 353             /* Possible nested comments */
00351   #pragma suppress 593             /* Define not used */
00352   #pragma suppress 61              /* enum has no name */
00353   #pragma suppress 106             /* unnamed, unused parameter */
00354   #include <clib.h>
00355 #endif
00356 
00357 /*
00358  * Large file (>2Gb) support using WIN32 functions.
00359  */
00360 
00361 #ifdef USE_WIN32_LARGE_FILES
00362 #  include <io.h>
00363 #  include <sys/types.h>
00364 #  include <sys/stat.h>
00365 #  undef  lseek
00366 #  define lseek(fdes,offset,whence)  _lseeki64(fdes, offset, whence)
00367 #  undef  fstat
00368 #  define fstat(fdes,stp)            _fstati64(fdes, stp)
00369 #  undef  stat
00370 #  define stat(fname,stp)            _stati64(fname, stp)
00371 #  define struct_stat                struct _stati64
00372 #  define LSEEK_ERROR                (__int64)-1
00373 #endif
00374 
00375 /*
00376  * Small file (<2Gb) support using WIN32 functions.
00377  */
00378 
00379 #ifdef USE_WIN32_SMALL_FILES
00380 #  include <io.h>
00381 #  include <sys/types.h>
00382 #  include <sys/stat.h>
00383 #  ifndef _WIN32_WCE
00384 #    undef  lseek
00385 #    define lseek(fdes,offset,whence)  _lseek(fdes, (long)offset, whence)
00386 #    define fstat(fdes,stp)            _fstat(fdes, stp)
00387 #    define stat(fname,stp)            _stat(fname, stp)
00388 #    define struct_stat                struct _stat
00389 #  endif
00390 #  define LSEEK_ERROR                (long)-1
00391 #endif
00392 
00393 #ifndef struct_stat
00394 #  define struct_stat struct stat
00395 #endif
00396 
00397 #ifndef LSEEK_ERROR
00398 #  define LSEEK_ERROR (off_t)-1
00399 #endif
00400 
00401 /*
00402  * Default sizeof(off_t) in case it hasn't been defined in config file.
00403  */
00404 
00405 #ifndef SIZEOF_OFF_T
00406 #  if defined(__VMS) && !defined(__VAX)
00407 #    if defined(_LARGEFILE)
00408 #      define SIZEOF_OFF_T 8
00409 #    endif
00410 #  elif defined(__OS400__) && defined(__ILEC400__)
00411 #    if defined(_LARGE_FILES)
00412 #      define SIZEOF_OFF_T 8
00413 #    endif
00414 #  elif defined(__MVS__) && defined(__IBMC__)
00415 #    if defined(_LP64) || defined(_LARGE_FILES)
00416 #      define SIZEOF_OFF_T 8
00417 #    endif
00418 #  elif defined(__370__) && defined(__IBMC__)
00419 #    if defined(_LP64) || defined(_LARGE_FILES)
00420 #      define SIZEOF_OFF_T 8
00421 #    endif
00422 #  endif
00423 #  ifndef SIZEOF_OFF_T
00424 #    define SIZEOF_OFF_T 4
00425 #  endif
00426 #endif
00427 
00428 /*
00429  * Arg 2 type for gethostname in case it hasn't been defined in config file.
00430  */
00431 
00432 #ifndef GETHOSTNAME_TYPE_ARG2
00433 #  ifdef USE_WINSOCK
00434 #    define GETHOSTNAME_TYPE_ARG2 int
00435 #  else
00436 #    define GETHOSTNAME_TYPE_ARG2 size_t
00437 #  endif
00438 #endif
00439 
00440 /* Below we define some functions. They should
00441 
00442    4. set the SIGALRM signal timeout
00443    5. set dir/file naming defines
00444    */
00445 
00446 #ifdef WIN32
00447 
00448 #  define DIR_CHAR      "\\"
00449 #  define DOT_CHAR      "_"
00450 
00451 #else /* WIN32 */
00452 
00453 #  ifdef MSDOS  /* Watt-32 */
00454 
00455 #    include <sys/ioctl.h>
00456 #    define select(n,r,w,x,t) select_s(n,r,w,x,t)
00457 #    define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z))
00458 #    include <tcp.h>
00459 #    ifdef word
00460 #      undef word
00461 #    endif
00462 #    ifdef byte
00463 #      undef byte
00464 #    endif
00465 
00466 #  endif /* MSDOS */
00467 
00468 #  ifdef __minix
00469      /* Minix 3 versions up to at least 3.1.3 are missing these prototypes */
00470      extern char *strtok_r(char *s, const char *delim, char **last);
00471      extern struct tm *gmtime_r(const time_t * const timep, struct tm *tmp);
00472 #  endif
00473 
00474 #  define DIR_CHAR      "/"
00475 #  ifndef DOT_CHAR
00476 #    define DOT_CHAR      "."
00477 #  endif
00478 
00479 #  ifdef MSDOS
00480 #    undef DOT_CHAR
00481 #    define DOT_CHAR      "_"
00482 #  endif
00483 
00484 #  ifndef fileno /* sunos 4 have this as a macro! */
00485      int fileno(FILE *stream);
00486 #  endif
00487 
00488 #endif /* WIN32 */
00489 
00490 /*
00491  * msvc 6.0 requires PSDK in order to have INET6_ADDRSTRLEN
00492  * defined in ws2tcpip.h as well as to provide IPv6 support.
00493  * Does not apply if lwIP is used.
00494  */
00495 
00496 #if defined(_MSC_VER) && !defined(__POCC__) && !defined(USE_LWIPSOCK)
00497 #  if !defined(HAVE_WS2TCPIP_H) || \
00498      ((_MSC_VER < 1300) && !defined(INET6_ADDRSTRLEN))
00499 #    undef HAVE_GETADDRINFO_THREADSAFE
00500 #    undef HAVE_FREEADDRINFO
00501 #    undef HAVE_GETADDRINFO
00502 #    undef HAVE_GETNAMEINFO
00503 #    undef ENABLE_IPV6
00504 #  endif
00505 #endif
00506 
00507 /* ---------------------------------------------------------------- */
00508 /*             resolver specialty compile-time defines              */
00509 /*         CURLRES_* defines to use in the host*.c sources          */
00510 /* ---------------------------------------------------------------- */
00511 
00512 /*
00513  * lcc-win32 doesn't have _beginthreadex(), lacks threads support.
00514  */
00515 
00516 #if defined(__LCC__) && defined(WIN32)
00517 #  undef USE_THREADS_POSIX
00518 #  undef USE_THREADS_WIN32
00519 #endif
00520 
00521 /*
00522  * MSVC threads support requires a multi-threaded runtime library.
00523  * _beginthreadex() is not available in single-threaded ones.
00524  */
00525 
00526 #if defined(_MSC_VER) && !defined(__POCC__) && !defined(_MT)
00527 #  undef USE_THREADS_POSIX
00528 #  undef USE_THREADS_WIN32
00529 #endif
00530 
00531 /*
00532  * Mutually exclusive CURLRES_* definitions.
00533  */
00534 
00535 #ifdef USE_ARES
00536 #  define CURLRES_ASYNCH
00537 #  define CURLRES_ARES
00538 /* now undef the stock libc functions just to avoid them being used */
00539 #  undef HAVE_GETADDRINFO
00540 #  undef HAVE_FREEADDRINFO
00541 #  undef HAVE_GETHOSTBYNAME
00542 #elif defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32)
00543 #  define CURLRES_ASYNCH
00544 #  define CURLRES_THREADED
00545 #else
00546 #  define CURLRES_SYNCH
00547 #endif
00548 
00549 #ifdef ENABLE_IPV6
00550 #  define CURLRES_IPV6
00551 #else
00552 #  define CURLRES_IPV4
00553 #endif
00554 
00555 /* ---------------------------------------------------------------- */
00556 
00557 /*
00558  * When using WINSOCK, TELNET protocol requires WINSOCK2 API.
00559  */
00560 
00561 #if defined(USE_WINSOCK) && (USE_WINSOCK != 2)
00562 #  define CURL_DISABLE_TELNET 1
00563 #endif
00564 
00565 /*
00566  * msvc 6.0 does not have struct sockaddr_storage and
00567  * does not define IPPROTO_ESP in winsock2.h. But both
00568  * are available if PSDK is properly installed.
00569  */
00570 
00571 #if defined(_MSC_VER) && !defined(__POCC__)
00572 #  if !defined(HAVE_WINSOCK2_H) || ((_MSC_VER < 1300) && !defined(IPPROTO_ESP))
00573 #    undef HAVE_STRUCT_SOCKADDR_STORAGE
00574 #  endif
00575 #endif
00576 
00577 /*
00578  * Intentionally fail to build when using msvc 6.0 without PSDK installed.
00579  * The brave of heart can circumvent this, defining ALLOW_MSVC6_WITHOUT_PSDK
00580  * in lib/config-win32.h although absolutely discouraged and unsupported.
00581  */
00582 
00583 #if defined(_MSC_VER) && !defined(__POCC__)
00584 #  if !defined(HAVE_WINDOWS_H) || ((_MSC_VER < 1300) && !defined(_FILETIME_))
00585 #    if !defined(ALLOW_MSVC6_WITHOUT_PSDK)
00586 #      error MSVC 6.0 requires "February 2003 Platform SDK" a.k.a. \
00587              "Windows Server 2003 PSDK"
00588 #    else
00589 #      define CURL_DISABLE_LDAP 1
00590 #    endif
00591 #  endif
00592 #endif
00593 
00594 #ifdef NETWARE
00595 int netware_init(void);
00596 #ifndef __NOVELL_LIBC__
00597 #include <sys/bsdskt.h>
00598 #include <sys/timeval.h>
00599 #endif
00600 #endif
00601 
00602 #if defined(HAVE_LIBIDN2) && defined(HAVE_IDN2_H)
00603 /* The lib and header are present */
00604 #define USE_LIBIDN2
00605 #endif
00606 
00607 #ifndef SIZEOF_TIME_T
00608 /* assume default size of time_t to be 32 bit */
00609 #define SIZEOF_TIME_T 4
00610 #endif
00611 
00612 #define LIBIDN_REQUIRED_VERSION "0.4.1"
00613 
00614 #if defined(USE_GNUTLS) || defined(USE_OPENSSL) || defined(USE_NSS) || \
00615     defined(USE_POLARSSL) || defined(USE_AXTLS) || defined(USE_MBEDTLS) || \
00616     defined(USE_CYASSL) || defined(USE_SCHANNEL) || \
00617     defined(USE_DARWINSSL) || defined(USE_GSKIT)
00618 #define USE_SSL    /* SSL support has been enabled */
00619 #endif
00620 
00621 /* Single point where USE_SPNEGO definition might be defined */
00622 #if !defined(CURL_DISABLE_CRYPTO_AUTH) && \
00623     (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI))
00624 #define USE_SPNEGO
00625 #endif
00626 
00627 /* Single point where USE_KERBEROS5 definition might be defined */
00628 #if !defined(CURL_DISABLE_CRYPTO_AUTH) && \
00629     (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI))
00630 #define USE_KERBEROS5
00631 #endif
00632 
00633 /* Single point where USE_NTLM definition might be defined */
00634 #if !defined(CURL_DISABLE_NTLM) && !defined(CURL_DISABLE_CRYPTO_AUTH)
00635 #if defined(USE_OPENSSL) || defined(USE_WINDOWS_SSPI) || \
00636     defined(USE_GNUTLS) || defined(USE_NSS) || defined(USE_DARWINSSL) || \
00637     defined(USE_OS400CRYPTO) || defined(USE_WIN32_CRYPTO)
00638 
00639 #define USE_NTLM
00640 
00641 #elif defined(USE_MBEDTLS)
00642 #  include <mbedtls/md4.h>
00643 #  if defined(MBEDTLS_MD4_C)
00644 #define USE_NTLM
00645 #  endif
00646 
00647 #endif
00648 #endif
00649 
00650 /* non-configure builds may define CURL_WANTS_CA_BUNDLE_ENV */
00651 #if defined(CURL_WANTS_CA_BUNDLE_ENV) && !defined(CURL_CA_BUNDLE)
00652 #define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")
00653 #endif
00654 
00655 /*
00656  * Provide a mechanism to silence picky compilers, such as gcc 4.6+.
00657  * Parameters should of course normally not be unused, but for example when
00658  * we have multiple implementations of the same interface it may happen.
00659  */
00660 
00661 #if defined(__GNUC__) && ((__GNUC__ >= 3) || \
00662   ((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 7)))
00663 #  define UNUSED_PARAM __attribute__((__unused__))
00664 #  define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
00665 #else
00666 #  define UNUSED_PARAM /*NOTHING*/
00667 #  define WARN_UNUSED_RESULT
00668 #endif
00669 
00670 /*
00671  * Include macros and defines that should only be processed once.
00672  */
00673 
00674 #ifndef HEADER_CURL_SETUP_ONCE_H
00675 #include "curl_setup_once.h"
00676 #endif
00677 
00678 /*
00679  * Definition of our NOP statement Object-like macro
00680  */
00681 
00682 #ifndef Curl_nop_stmt
00683 #  define Curl_nop_stmt do { } WHILE_FALSE
00684 #endif
00685 
00686 /*
00687  * Ensure that Winsock and lwIP TCP/IP stacks are not mixed.
00688  */
00689 
00690 #if defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H)
00691 #  if defined(SOCKET) || \
00692      defined(USE_WINSOCK) || \
00693      defined(HAVE_WINSOCK_H) || \
00694      defined(HAVE_WINSOCK2_H) || \
00695      defined(HAVE_WS2TCPIP_H)
00696 #    error "Winsock and lwIP TCP/IP stack definitions shall not coexist!"
00697 #  endif
00698 #endif
00699 
00700 /*
00701  * Portable symbolic names for Winsock shutdown() mode flags.
00702  */
00703 
00704 #ifdef USE_WINSOCK
00705 #  define SHUT_RD   0x00
00706 #  define SHUT_WR   0x01
00707 #  define SHUT_RDWR 0x02
00708 #endif
00709 
00710 /* Define S_ISREG if not defined by system headers, f.e. MSVC */
00711 #if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG)
00712 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
00713 #endif
00714 
00715 /* Define S_ISDIR if not defined by system headers, f.e. MSVC */
00716 #if !defined(S_ISDIR) && defined(S_IFMT) && defined(S_IFDIR)
00717 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
00718 #endif
00719 
00720 /* In Windows the default file mode is text but an application can override it.
00721 Therefore we specify it explicitly. https://github.com/curl/curl/pull/258
00722 */
00723 #if defined(WIN32) || defined(MSDOS)
00724 #define FOPEN_READTEXT "rt"
00725 #define FOPEN_WRITETEXT "wt"
00726 #elif defined(__CYGWIN__)
00727 /* Cygwin has specific behavior we need to address when WIN32 is not defined.
00728 https://cygwin.com/cygwin-ug-net/using-textbinary.html
00729 For write we want our output to have line endings of LF and be compatible with
00730 other Cygwin utilities. For read we want to handle input that may have line
00731 endings either CRLF or LF so 't' is appropriate.
00732 */
00733 #define FOPEN_READTEXT "rt"
00734 #define FOPEN_WRITETEXT "w"
00735 #else
00736 #define FOPEN_READTEXT "r"
00737 #define FOPEN_WRITETEXT "w"
00738 #endif
00739 
00740 /* WinSock destroys recv() buffer when send() failed.
00741  * Enabled automatically for Windows and for Cygwin as Cygwin sockets are
00742  * wrappers for WinSock sockets. https://github.com/curl/curl/issues/657
00743  * Define DONT_USE_RECV_BEFORE_SEND_WORKAROUND to force disable workaround.
00744  */
00745 #if !defined(DONT_USE_RECV_BEFORE_SEND_WORKAROUND)
00746 #  if defined(WIN32) || defined(__CYGWIN__)
00747 #    define USE_RECV_BEFORE_SEND_WORKAROUND
00748 #  endif
00749 #else  /* DONT_USE_RECV_BEFORE_SEND_WORKAROUNDS */
00750 #  ifdef USE_RECV_BEFORE_SEND_WORKAROUND
00751 #    undef USE_RECV_BEFORE_SEND_WORKAROUND
00752 #  endif
00753 #endif /* DONT_USE_RECV_BEFORE_SEND_WORKAROUNDS */
00754 
00755 /* Detect Windows App environment which has a restricted access
00756  * to the Win32 APIs. */
00757 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0602)
00758 #  include <winapifamily.h>
00759 #  if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \
00760      !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
00761 #    define CURL_WINDOWS_APP
00762 #  endif
00763 # endif
00764 
00765 #endif /* HEADER_CURL_SETUP_H */


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:02