curl_setup.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  1. #ifndef HEADER_CURL_SETUP_H
  2. #define HEADER_CURL_SETUP_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2013, 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 http://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. * Define WIN32 when build target is Win32 API
  26. */
  27. #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) && \
  28. !defined(__SYMBIAN32__)
  29. #define WIN32
  30. #endif
  31. /*
  32. * Include configuration script results or hand-crafted
  33. * configuration file for platforms which lack config tool.
  34. */
  35. #ifdef HAVE_CONFIG_H
  36. #include "curl_config.h"
  37. #else /* HAVE_CONFIG_H */
  38. #ifdef _WIN32_WCE
  39. # include "config-win32ce.h"
  40. #else
  41. # ifdef WIN32
  42. # include "config-win32.h"
  43. # endif
  44. #endif
  45. #if defined(macintosh) && defined(__MRC__)
  46. # include "config-mac.h"
  47. #endif
  48. #ifdef __riscos__
  49. # include "config-riscos.h"
  50. #endif
  51. #ifdef __AMIGA__
  52. # include "config-amigaos.h"
  53. #endif
  54. #ifdef __SYMBIAN32__
  55. # include "config-symbian.h"
  56. #endif
  57. #ifdef __OS400__
  58. # include "config-os400.h"
  59. #endif
  60. #ifdef TPF
  61. # include "config-tpf.h"
  62. #endif
  63. #ifdef __VXWORKS__
  64. # include "config-vxworks.h"
  65. #endif
  66. #endif /* HAVE_CONFIG_H */
  67. /* ================================================================ */
  68. /* Definition of preprocessor macros/symbols which modify compiler */
  69. /* behavior or generated code characteristics must be done here, */
  70. /* as appropriate, before any system header file is included. It is */
  71. /* also possible to have them defined in the config file included */
  72. /* before this point. As a result of all this we frown inclusion of */
  73. /* system header files in our config files, avoid this at any cost. */
  74. /* ================================================================ */
  75. /*
  76. * AIX 4.3 and newer needs _THREAD_SAFE defined to build
  77. * proper reentrant code. Others may also need it.
  78. */
  79. #ifdef NEED_THREAD_SAFE
  80. # ifndef _THREAD_SAFE
  81. # define _THREAD_SAFE
  82. # endif
  83. #endif
  84. /*
  85. * Tru64 needs _REENTRANT set for a few function prototypes and
  86. * things to appear in the system header files. Unixware needs it
  87. * to build proper reentrant code. Others may also need it.
  88. */
  89. #ifdef NEED_REENTRANT
  90. # ifndef _REENTRANT
  91. # define _REENTRANT
  92. # endif
  93. #endif
  94. /* ================================================================ */
  95. /* If you need to include a system header file for your platform, */
  96. /* please, do it beyond the point further indicated in this file. */
  97. /* ================================================================ */
  98. /*
  99. * libcurl's external interface definitions are also used internally,
  100. * and might also include required system header files to define them.
  101. */
  102. #include <curl/curlbuild.h>
  103. /*
  104. * Compile time sanity checks must also be done when building the library.
  105. */
  106. #include <curl/curlrules.h>
  107. /*
  108. * Ensure that no one is using the old SIZEOF_CURL_OFF_T macro
  109. */
  110. #ifdef SIZEOF_CURL_OFF_T
  111. # error "SIZEOF_CURL_OFF_T shall not be defined!"
  112. Error Compilation_aborted_SIZEOF_CURL_OFF_T_shall_not_be_defined
  113. #endif
  114. /*
  115. * Disable other protocols when http is the only one desired.
  116. */
  117. #ifdef HTTP_ONLY
  118. # ifndef CURL_DISABLE_TFTP
  119. # define CURL_DISABLE_TFTP
  120. # endif
  121. # ifndef CURL_DISABLE_FTP
  122. # define CURL_DISABLE_FTP
  123. # endif
  124. # ifndef CURL_DISABLE_LDAP
  125. # define CURL_DISABLE_LDAP
  126. # endif
  127. # ifndef CURL_DISABLE_TELNET
  128. # define CURL_DISABLE_TELNET
  129. # endif
  130. # ifndef CURL_DISABLE_DICT
  131. # define CURL_DISABLE_DICT
  132. # endif
  133. # ifndef CURL_DISABLE_FILE
  134. # define CURL_DISABLE_FILE
  135. # endif
  136. # ifndef CURL_DISABLE_RTSP
  137. # define CURL_DISABLE_RTSP
  138. # endif
  139. # ifndef CURL_DISABLE_POP3
  140. # define CURL_DISABLE_POP3
  141. # endif
  142. # ifndef CURL_DISABLE_IMAP
  143. # define CURL_DISABLE_IMAP
  144. # endif
  145. # ifndef CURL_DISABLE_SMTP
  146. # define CURL_DISABLE_SMTP
  147. # endif
  148. # ifndef CURL_DISABLE_RTSP
  149. # define CURL_DISABLE_RTSP
  150. # endif
  151. # ifndef CURL_DISABLE_RTMP
  152. # define CURL_DISABLE_RTMP
  153. # endif
  154. # ifndef CURL_DISABLE_GOPHER
  155. # define CURL_DISABLE_GOPHER
  156. # endif
  157. #endif
  158. /*
  159. * When http is disabled rtsp is not supported.
  160. */
  161. #if defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_RTSP)
  162. # define CURL_DISABLE_RTSP
  163. #endif
  164. /* ================================================================ */
  165. /* No system header file shall be included in this file before this */
  166. /* point. The only allowed ones are those included from curlbuild.h */
  167. /* ================================================================ */
  168. /*
  169. * OS/400 setup file includes some system headers.
  170. */
  171. #ifdef __OS400__
  172. # include "setup-os400.h"
  173. #endif
  174. /*
  175. * VMS setup file includes some system headers.
  176. */
  177. #ifdef __VMS
  178. # include "setup-vms.h"
  179. #endif
  180. /*
  181. * Include header files for windows builds before redefining anything.
  182. * Use this preprocessor block only to include or exclude windows.h,
  183. * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
  184. * to any other further and independent block. Under Cygwin things work
  185. * just as under linux (e.g. <sys/socket.h>) and the winsock headers should
  186. * never be included when __CYGWIN__ is defined. configure script takes
  187. * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
  188. * neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
  189. */
  190. #ifdef HAVE_WINDOWS_H
  191. # if defined(UNICODE) && !defined(_UNICODE)
  192. # define _UNICODE
  193. # endif
  194. # if defined(_UNICODE) && !defined(UNICODE)
  195. # define UNICODE
  196. # endif
  197. # ifndef WIN32_LEAN_AND_MEAN
  198. # define WIN32_LEAN_AND_MEAN
  199. # endif
  200. # include <windows.h>
  201. # ifdef HAVE_WINSOCK2_H
  202. # include <winsock2.h>
  203. # ifdef HAVE_WS2TCPIP_H
  204. # include <ws2tcpip.h>
  205. # endif
  206. # else
  207. # ifdef HAVE_WINSOCK_H
  208. # include <winsock.h>
  209. # endif
  210. # endif
  211. # include <tchar.h>
  212. # ifdef UNICODE
  213. typedef wchar_t *(*curl_wcsdup_callback)(const wchar_t *str);
  214. # endif
  215. #endif
  216. /*
  217. * Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else
  218. * define USE_WINSOCK to 1 if we have and use WINSOCK API, else
  219. * undefine USE_WINSOCK.
  220. */
  221. #undef USE_WINSOCK
  222. #ifdef HAVE_WINSOCK2_H
  223. # define USE_WINSOCK 2
  224. #else
  225. # ifdef HAVE_WINSOCK_H
  226. # define USE_WINSOCK 1
  227. # endif
  228. #endif
  229. #ifdef USE_LWIPSOCK
  230. # include <lwip/init.h>
  231. # include <lwip/sockets.h>
  232. # include <lwip/netdb.h>
  233. #endif
  234. #ifdef HAVE_EXTRA_STRICMP_H
  235. # include <extra/stricmp.h>
  236. #endif
  237. #ifdef HAVE_EXTRA_STRDUP_H
  238. # include <extra/strdup.h>
  239. #endif
  240. #ifdef TPF
  241. # include <strings.h> /* for bzero, strcasecmp, and strncasecmp */
  242. # include <string.h> /* for strcpy and strlen */
  243. # include <stdlib.h> /* for rand and srand */
  244. # include <sys/socket.h> /* for select and ioctl*/
  245. # include <netdb.h> /* for in_addr_t definition */
  246. # include <tpf/sysapi.h> /* for tpf_process_signals */
  247. /* change which select is used for libcurl */
  248. # define select(a,b,c,d,e) tpf_select_libcurl(a,b,c,d,e)
  249. #endif
  250. #ifdef __VXWORKS__
  251. # include <sockLib.h> /* for generic BSD socket functions */
  252. # include <ioLib.h> /* for basic I/O interface functions */
  253. #endif
  254. #ifdef __AMIGA__
  255. # ifndef __ixemul__
  256. # include <exec/types.h>
  257. # include <exec/execbase.h>
  258. # include <proto/exec.h>
  259. # include <proto/dos.h>
  260. # define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
  261. # endif
  262. #endif
  263. #include <stdio.h>
  264. #ifdef HAVE_ASSERT_H
  265. #include <assert.h>
  266. #endif
  267. #ifdef __TANDEM /* for nsr-tandem-nsk systems */
  268. #include <floss.h>
  269. #endif
  270. #ifndef STDC_HEADERS /* no standard C headers! */
  271. #include <curl/stdcheaders.h>
  272. #endif
  273. #ifdef __POCC__
  274. # include <sys/types.h>
  275. # include <unistd.h>
  276. # define sys_nerr EILSEQ
  277. #endif
  278. /*
  279. * Salford-C kludge section (mostly borrowed from wxWidgets).
  280. */
  281. #ifdef __SALFORDC__
  282. #pragma suppress 353 /* Possible nested comments */
  283. #pragma suppress 593 /* Define not used */
  284. #pragma suppress 61 /* enum has no name */
  285. #pragma suppress 106 /* unnamed, unused parameter */
  286. #include <clib.h>
  287. #endif
  288. /*
  289. * Large file (>2Gb) support using WIN32 functions.
  290. */
  291. #ifdef USE_WIN32_LARGE_FILES
  292. # include <io.h>
  293. # include <sys/types.h>
  294. # include <sys/stat.h>
  295. # undef lseek
  296. # define lseek(fdes,offset,whence) _lseeki64(fdes, offset, whence)
  297. # undef fstat
  298. # define fstat(fdes,stp) _fstati64(fdes, stp)
  299. # undef stat
  300. # define stat(fname,stp) _stati64(fname, stp)
  301. # define struct_stat struct _stati64
  302. # define LSEEK_ERROR (__int64)-1
  303. #endif
  304. /*
  305. * Small file (<2Gb) support using WIN32 functions.
  306. */
  307. #ifdef USE_WIN32_SMALL_FILES
  308. # include <io.h>
  309. # include <sys/types.h>
  310. # include <sys/stat.h>
  311. # ifndef _WIN32_WCE
  312. # undef lseek
  313. # define lseek(fdes,offset,whence) _lseek(fdes, (long)offset, whence)
  314. # define fstat(fdes,stp) _fstat(fdes, stp)
  315. # define stat(fname,stp) _stat(fname, stp)
  316. # define struct_stat struct _stat
  317. # endif
  318. # define LSEEK_ERROR (long)-1
  319. #endif
  320. #ifndef struct_stat
  321. # define struct_stat struct stat
  322. #endif
  323. #ifndef LSEEK_ERROR
  324. # define LSEEK_ERROR (off_t)-1
  325. #endif
  326. /*
  327. * Default sizeof(off_t) in case it hasn't been defined in config file.
  328. */
  329. #ifndef SIZEOF_OFF_T
  330. # if defined(__VMS) && !defined(__VAX)
  331. # if defined(_LARGEFILE)
  332. # define SIZEOF_OFF_T 8
  333. # endif
  334. # elif defined(__OS400__) && defined(__ILEC400__)
  335. # if defined(_LARGE_FILES)
  336. # define SIZEOF_OFF_T 8
  337. # endif
  338. # elif defined(__MVS__) && defined(__IBMC__)
  339. # if defined(_LP64) || defined(_LARGE_FILES)
  340. # define SIZEOF_OFF_T 8
  341. # endif
  342. # elif defined(__370__) && defined(__IBMC__)
  343. # if defined(_LP64) || defined(_LARGE_FILES)
  344. # define SIZEOF_OFF_T 8
  345. # endif
  346. # endif
  347. # ifndef SIZEOF_OFF_T
  348. # define SIZEOF_OFF_T 4
  349. # endif
  350. #endif
  351. /*
  352. * Arg 2 type for gethostname in case it hasn't been defined in config file.
  353. */
  354. #ifndef GETHOSTNAME_TYPE_ARG2
  355. # ifdef USE_WINSOCK
  356. # define GETHOSTNAME_TYPE_ARG2 int
  357. # else
  358. # define GETHOSTNAME_TYPE_ARG2 size_t
  359. # endif
  360. #endif
  361. /* Below we define some functions. They should
  362. 4. set the SIGALRM signal timeout
  363. 5. set dir/file naming defines
  364. */
  365. #ifdef WIN32
  366. # define DIR_CHAR "\\"
  367. # define DOT_CHAR "_"
  368. #else /* WIN32 */
  369. # ifdef MSDOS /* Watt-32 */
  370. # include <sys/ioctl.h>
  371. # define select(n,r,w,x,t) select_s(n,r,w,x,t)
  372. # define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z))
  373. # include <tcp.h>
  374. # ifdef word
  375. # undef word
  376. # endif
  377. # ifdef byte
  378. # undef byte
  379. # endif
  380. # endif /* MSDOS */
  381. # ifdef __minix
  382. /* Minix 3 versions up to at least 3.1.3 are missing these prototypes */
  383. extern char * strtok_r(char *s, const char *delim, char **last);
  384. extern struct tm * gmtime_r(const time_t * const timep, struct tm *tmp);
  385. # endif
  386. # define DIR_CHAR "/"
  387. # ifndef DOT_CHAR
  388. # define DOT_CHAR "."
  389. # endif
  390. # ifdef MSDOS
  391. # undef DOT_CHAR
  392. # define DOT_CHAR "_"
  393. # endif
  394. # ifndef fileno /* sunos 4 have this as a macro! */
  395. int fileno( FILE *stream);
  396. # endif
  397. #endif /* WIN32 */
  398. /*
  399. * msvc 6.0 requires PSDK in order to have INET6_ADDRSTRLEN
  400. * defined in ws2tcpip.h as well as to provide IPv6 support.
  401. */
  402. #if defined(_MSC_VER) && !defined(__POCC__)
  403. # if !defined(HAVE_WS2TCPIP_H) || \
  404. ((_MSC_VER < 1300) && !defined(INET6_ADDRSTRLEN))
  405. # undef HAVE_GETADDRINFO_THREADSAFE
  406. # undef HAVE_FREEADDRINFO
  407. # undef HAVE_GETADDRINFO
  408. # undef HAVE_GETNAMEINFO
  409. # undef ENABLE_IPV6
  410. # endif
  411. #endif
  412. /* ---------------------------------------------------------------- */
  413. /* resolver specialty compile-time defines */
  414. /* CURLRES_* defines to use in the host*.c sources */
  415. /* ---------------------------------------------------------------- */
  416. /*
  417. * lcc-win32 doesn't have _beginthreadex(), lacks threads support.
  418. */
  419. #if defined(__LCC__) && defined(WIN32)
  420. # undef USE_THREADS_POSIX
  421. # undef USE_THREADS_WIN32
  422. #endif
  423. /*
  424. * MSVC threads support requires a multi-threaded runtime library.
  425. * _beginthreadex() is not available in single-threaded ones.
  426. */
  427. #if defined(_MSC_VER) && !defined(__POCC__) && !defined(_MT)
  428. # undef USE_THREADS_POSIX
  429. # undef USE_THREADS_WIN32
  430. #endif
  431. /*
  432. * Mutually exclusive CURLRES_* definitions.
  433. */
  434. #ifdef USE_ARES
  435. # define CURLRES_ASYNCH
  436. # define CURLRES_ARES
  437. /* now undef the stock libc functions just to avoid them being used */
  438. # undef HAVE_GETADDRINFO
  439. # undef HAVE_GETHOSTBYNAME
  440. #elif defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32)
  441. # define CURLRES_ASYNCH
  442. # define CURLRES_THREADED
  443. #else
  444. # define CURLRES_SYNCH
  445. #endif
  446. #ifdef ENABLE_IPV6
  447. # define CURLRES_IPV6
  448. #else
  449. # define CURLRES_IPV4
  450. #endif
  451. /* ---------------------------------------------------------------- */
  452. /*
  453. * When using WINSOCK, TELNET protocol requires WINSOCK2 API.
  454. */
  455. #if defined(USE_WINSOCK) && (USE_WINSOCK != 2)
  456. # define CURL_DISABLE_TELNET 1
  457. #endif
  458. /*
  459. * msvc 6.0 does not have struct sockaddr_storage and
  460. * does not define IPPROTO_ESP in winsock2.h. But both
  461. * are available if PSDK is properly installed.
  462. */
  463. #if defined(_MSC_VER) && !defined(__POCC__)
  464. # if !defined(HAVE_WINSOCK2_H) || ((_MSC_VER < 1300) && !defined(IPPROTO_ESP))
  465. # undef HAVE_STRUCT_SOCKADDR_STORAGE
  466. # endif
  467. #endif
  468. /*
  469. * Intentionally fail to build when using msvc 6.0 without PSDK installed.
  470. * The brave of heart can circumvent this, defining ALLOW_MSVC6_WITHOUT_PSDK
  471. * in lib/config-win32.h although absolutely discouraged and unsupported.
  472. */
  473. #if defined(_MSC_VER) && !defined(__POCC__)
  474. # if !defined(HAVE_WINDOWS_H) || ((_MSC_VER < 1300) && !defined(_FILETIME_))
  475. # if !defined(ALLOW_MSVC6_WITHOUT_PSDK)
  476. # error MSVC 6.0 requires "February 2003 Platform SDK" a.k.a. \
  477. "Windows Server 2003 PSDK"
  478. # else
  479. # define CURL_DISABLE_LDAP 1
  480. # endif
  481. # endif
  482. #endif
  483. #ifdef NETWARE
  484. int netware_init(void);
  485. #ifndef __NOVELL_LIBC__
  486. #include <sys/bsdskt.h>
  487. #include <sys/timeval.h>
  488. #endif
  489. #endif
  490. #if defined(HAVE_LIBIDN) && defined(HAVE_TLD_H)
  491. /* The lib was present and the tld.h header (which is missing in libidn 0.3.X
  492. but we only work with libidn 0.4.1 or later) */
  493. #define USE_LIBIDN
  494. #endif
  495. #ifndef SIZEOF_TIME_T
  496. /* assume default size of time_t to be 32 bit */
  497. #define SIZEOF_TIME_T 4
  498. #endif
  499. #define LIBIDN_REQUIRED_VERSION "0.4.1"
  500. #if defined(USE_GNUTLS) || defined(USE_SSLEAY) || defined(USE_NSS) || \
  501. defined(USE_QSOSSL) || defined(USE_POLARSSL) || defined(USE_AXTLS) || \
  502. defined(USE_CYASSL) || defined(USE_SCHANNEL) || \
  503. defined(USE_DARWINSSL) || defined(USE_GSKIT)
  504. #define USE_SSL /* SSL support has been enabled */
  505. #endif
  506. #if !defined(CURL_DISABLE_CRYPTO_AUTH) && \
  507. (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI))
  508. #define USE_HTTP_NEGOTIATE
  509. #endif
  510. /* Single point where USE_NTLM definition might be done */
  511. #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_NTLM) && \
  512. !defined(CURL_DISABLE_CRYPTO_AUTH)
  513. #if defined(USE_SSLEAY) || defined(USE_WINDOWS_SSPI) || \
  514. defined(USE_GNUTLS) || defined(USE_NSS) || defined(USE_DARWINSSL)
  515. #define USE_NTLM
  516. #endif
  517. #endif
  518. /* non-configure builds may define CURL_WANTS_CA_BUNDLE_ENV */
  519. #if defined(CURL_WANTS_CA_BUNDLE_ENV) && !defined(CURL_CA_BUNDLE)
  520. #define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")
  521. #endif
  522. /*
  523. * Provide a mechanism to silence picky compilers, such as gcc 4.6+.
  524. * Parameters should of course normally not be unused, but for example when
  525. * we have multiple implementations of the same interface it may happen.
  526. */
  527. #if defined(__GNUC__) && ((__GNUC__ >= 3) || \
  528. ((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 7)))
  529. # define UNUSED_PARAM __attribute__((__unused__))
  530. #else
  531. # define UNUSED_PARAM /*NOTHING*/
  532. #endif
  533. /*
  534. * Include macros and defines that should only be processed once.
  535. */
  536. #ifndef HEADER_CURL_SETUP_ONCE_H
  537. #include "curl_setup_once.h"
  538. #endif
  539. /*
  540. * Definition of our NOP statement Object-like macro
  541. */
  542. #ifndef Curl_nop_stmt
  543. # define Curl_nop_stmt do { } WHILE_FALSE
  544. #endif
  545. /*
  546. * Ensure that Winsock and lwIP TCP/IP stacks are not mixed.
  547. */
  548. #if defined(__LWIP_OPT_H__)
  549. # if defined(SOCKET) || \
  550. defined(USE_WINSOCK) || \
  551. defined(HAVE_WINSOCK_H) || \
  552. defined(HAVE_WINSOCK2_H) || \
  553. defined(HAVE_WS2TCPIP_H)
  554. # error "Winsock and lwIP TCP/IP stack definitions shall not coexist!"
  555. # endif
  556. #endif
  557. /*
  558. * Portable symbolic names for Winsock shutdown() mode flags.
  559. */
  560. #ifdef USE_WINSOCK
  561. # define SHUT_RD 0x00
  562. # define SHUT_WR 0x01
  563. # define SHUT_RDWR 0x02
  564. #endif
  565. /* Define S_ISREG if not defined by system headers, f.e. MSVC */
  566. #if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG)
  567. #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
  568. #endif
  569. /* Define S_ISDIR if not defined by system headers, f.e. MSVC */
  570. #if !defined(S_ISDIR) && defined(S_IFMT) && defined(S_IFDIR)
  571. #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
  572. #endif
  573. #endif /* HEADER_CURL_SETUP_H */