config-win32.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. #ifndef HEADER_CURL_CONFIG_WIN32_H
  2. #define HEADER_CURL_CONFIG_WIN32_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. /* Hand crafted config file for Windows */
  28. /* ================================================================ */
  29. /* ---------------------------------------------------------------- */
  30. /* HEADER FILES */
  31. /* ---------------------------------------------------------------- */
  32. /* Define if you have the <arpa/inet.h> header file. */
  33. /* #define HAVE_ARPA_INET_H 1 */
  34. /* Define if you have the <fcntl.h> header file. */
  35. #define HAVE_FCNTL_H 1
  36. /* Define if you have the <io.h> header file. */
  37. #define HAVE_IO_H 1
  38. /* Define if you have the <locale.h> header file. */
  39. #define HAVE_LOCALE_H 1
  40. /* Define if you need <malloc.h> header even with <stdlib.h> header file. */
  41. #define NEED_MALLOC_H 1
  42. /* Define if you have the <netdb.h> header file. */
  43. /* #define HAVE_NETDB_H 1 */
  44. /* Define if you have the <netinet/in.h> header file. */
  45. /* #define HAVE_NETINET_IN_H 1 */
  46. /* Define to 1 if you have the <stdbool.h> header file. */
  47. #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__)
  48. #define HAVE_STDBOOL_H 1
  49. #endif
  50. /* Define if you have the <sys/param.h> header file. */
  51. #if defined(__MINGW32__)
  52. #define HAVE_SYS_PARAM_H 1
  53. #endif
  54. /* Define if you have the <sys/select.h> header file. */
  55. /* #define HAVE_SYS_SELECT_H 1 */
  56. /* Define if you have the <sys/socket.h> header file. */
  57. /* #define HAVE_SYS_SOCKET_H 1 */
  58. /* Define if you have the <sys/sockio.h> header file. */
  59. /* #define HAVE_SYS_SOCKIO_H 1 */
  60. /* Define if you have the <sys/stat.h> header file. */
  61. #define HAVE_SYS_STAT_H 1
  62. /* Define if you have the <sys/time.h> header file. */
  63. #if defined(__MINGW32__)
  64. #define HAVE_SYS_TIME_H 1
  65. #endif
  66. /* Define if you have the <sys/types.h> header file. */
  67. #define HAVE_SYS_TYPES_H 1
  68. /* Define if you have the <sys/utime.h> header file. */
  69. #define HAVE_SYS_UTIME_H 1
  70. /* Define if you have the <termio.h> header file. */
  71. /* #define HAVE_TERMIO_H 1 */
  72. /* Define if you have the <termios.h> header file. */
  73. /* #define HAVE_TERMIOS_H 1 */
  74. /* Define if you have the <unistd.h> header file. */
  75. #if defined(__MINGW32__)
  76. #define HAVE_UNISTD_H 1
  77. #endif
  78. /* Define if you have the <windows.h> header file. */
  79. #define HAVE_WINDOWS_H 1
  80. /* Define if you have the <winsock2.h> header file. */
  81. #define HAVE_WINSOCK2_H 1
  82. /* Define if you have the <ws2tcpip.h> header file. */
  83. #define HAVE_WS2TCPIP_H 1
  84. /* Define to 1 if you have the <libgen.h> header file. */
  85. #if defined(__MINGW32__)
  86. #define HAVE_LIBGEN_H 1
  87. #endif
  88. /* ---------------------------------------------------------------- */
  89. /* OTHER HEADER INFO */
  90. /* ---------------------------------------------------------------- */
  91. /* Define if you have the ANSI C header files. */
  92. #define STDC_HEADERS 1
  93. /* Define to 1 if bool is an available type. */
  94. #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__)
  95. #define HAVE_BOOL_T 1
  96. #endif
  97. /* ---------------------------------------------------------------- */
  98. /* FUNCTIONS */
  99. /* ---------------------------------------------------------------- */
  100. /* Define if you have the closesocket function. */
  101. #define HAVE_CLOSESOCKET 1
  102. /* Define if you have the ftruncate function. */
  103. #if defined(__MINGW32__)
  104. #define HAVE_FTRUNCATE 1
  105. #endif
  106. /* Define to 1 if you have the `getpeername' function. */
  107. #define HAVE_GETPEERNAME 1
  108. /* Define to 1 if you have the getsockname function. */
  109. #define HAVE_GETSOCKNAME 1
  110. /* Define if you have the gethostname function. */
  111. #define HAVE_GETHOSTNAME 1
  112. /* Define if you have the gettimeofday function. */
  113. #if defined(__MINGW32__)
  114. #define HAVE_GETTIMEOFDAY 1
  115. #endif
  116. /* Define if you have the ioctlsocket function. */
  117. #define HAVE_IOCTLSOCKET 1
  118. /* Define if you have a working ioctlsocket FIONBIO function. */
  119. #define HAVE_IOCTLSOCKET_FIONBIO 1
  120. /* Define if you have the select function. */
  121. #define HAVE_SELECT 1
  122. /* Define if you have the setlocale function. */
  123. #define HAVE_SETLOCALE 1
  124. /* Define if you have the setmode function. */
  125. #define HAVE_SETMODE 1
  126. /* Define if you have the socket function. */
  127. #define HAVE_SOCKET 1
  128. /* Define if you have the strcasecmp function. */
  129. #if defined(__MINGW32__)
  130. #define HAVE_STRCASECMP 1
  131. #endif
  132. /* Define if you have the strdup function. */
  133. #define HAVE_STRDUP 1
  134. /* Define if you have the stricmp function. */
  135. #define HAVE_STRICMP 1
  136. /* Define if you have the strtoll function. */
  137. #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__)
  138. #define HAVE_STRTOLL 1
  139. #endif
  140. /* Define if you have the utime function. */
  141. #define HAVE_UTIME 1
  142. /* Define if you have the recv function. */
  143. #define HAVE_RECV 1
  144. /* Define to the type of arg 1 for recv. */
  145. #define RECV_TYPE_ARG1 SOCKET
  146. /* Define to the type of arg 2 for recv. */
  147. #define RECV_TYPE_ARG2 char *
  148. /* Define to the type of arg 3 for recv. */
  149. #define RECV_TYPE_ARG3 int
  150. /* Define to the type of arg 4 for recv. */
  151. #define RECV_TYPE_ARG4 int
  152. /* Define to the function return type for recv. */
  153. #define RECV_TYPE_RETV int
  154. /* Define if you have the send function. */
  155. #define HAVE_SEND 1
  156. /* Define to the type of arg 1 for send. */
  157. #define SEND_TYPE_ARG1 SOCKET
  158. /* Define to the type qualifier of arg 2 for send. */
  159. #define SEND_QUAL_ARG2 const
  160. /* Define to the type of arg 2 for send. */
  161. #define SEND_TYPE_ARG2 char *
  162. /* Define to the type of arg 3 for send. */
  163. #define SEND_TYPE_ARG3 int
  164. /* Define to the type of arg 4 for send. */
  165. #define SEND_TYPE_ARG4 int
  166. /* Define to the function return type for send. */
  167. #define SEND_TYPE_RETV int
  168. /* Define to 1 if you have the snprintf function. */
  169. #if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || defined(__MINGW32__)
  170. #define HAVE_SNPRINTF 1
  171. #endif
  172. #if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600 /* Vista */
  173. /* Define to 1 if you have a IPv6 capable working inet_ntop function. */
  174. #define HAVE_INET_NTOP 1
  175. /* Define to 1 if you have a IPv6 capable working inet_pton function. */
  176. #define HAVE_INET_PTON 1
  177. #endif
  178. /* Define to 1 if you have the `basename' function. */
  179. #if defined(__MINGW32__)
  180. #define HAVE_BASENAME 1
  181. #endif
  182. /* Define to 1 if you have the strtok_r function. */
  183. #if defined(__MINGW32__)
  184. #define HAVE_STRTOK_R 1
  185. #endif
  186. /* Define to 1 if you have the signal function. */
  187. #define HAVE_SIGNAL 1
  188. /* ---------------------------------------------------------------- */
  189. /* TYPEDEF REPLACEMENTS */
  190. /* ---------------------------------------------------------------- */
  191. /* Define if in_addr_t is not an available 'typedefed' type. */
  192. #define in_addr_t unsigned long
  193. /* Define if ssize_t is not an available 'typedefed' type. */
  194. #ifndef _SSIZE_T_DEFINED
  195. # if defined(__MINGW32__)
  196. # elif defined(_WIN64)
  197. # define _SSIZE_T_DEFINED
  198. # define ssize_t __int64
  199. # else
  200. # define _SSIZE_T_DEFINED
  201. # define ssize_t int
  202. # endif
  203. #endif
  204. /* ---------------------------------------------------------------- */
  205. /* TYPE SIZES */
  206. /* ---------------------------------------------------------------- */
  207. /* Define to the size of `int', as computed by sizeof. */
  208. #define SIZEOF_INT 4
  209. /* Define to the size of `long long', as computed by sizeof. */
  210. /* #define SIZEOF_LONG_LONG 8 */
  211. /* Define to the size of `long', as computed by sizeof. */
  212. #define SIZEOF_LONG 4
  213. /* Define to the size of `size_t', as computed by sizeof. */
  214. #if defined(_WIN64)
  215. # define SIZEOF_SIZE_T 8
  216. #else
  217. # define SIZEOF_SIZE_T 4
  218. #endif
  219. /* Define to the size of `curl_off_t', as computed by sizeof. */
  220. #define SIZEOF_CURL_OFF_T 8
  221. /* ---------------------------------------------------------------- */
  222. /* BSD-style lwIP TCP/IP stack SPECIFIC */
  223. /* ---------------------------------------------------------------- */
  224. /* Define to use BSD-style lwIP TCP/IP stack. */
  225. /* #define USE_LWIPSOCK 1 */
  226. #ifdef USE_LWIPSOCK
  227. # undef USE_WINSOCK
  228. # undef HAVE_WINSOCK2_H
  229. # undef HAVE_WS2TCPIP_H
  230. # undef HAVE_GETHOSTNAME
  231. # undef LWIP_POSIX_SOCKETS_IO_NAMES
  232. # undef RECV_TYPE_ARG1
  233. # undef RECV_TYPE_ARG3
  234. # undef SEND_TYPE_ARG1
  235. # undef SEND_TYPE_ARG3
  236. # define HAVE_GETHOSTBYNAME_R
  237. # define HAVE_GETHOSTBYNAME_R_6
  238. # define LWIP_POSIX_SOCKETS_IO_NAMES 0
  239. # define RECV_TYPE_ARG1 int
  240. # define RECV_TYPE_ARG3 size_t
  241. # define SEND_TYPE_ARG1 int
  242. # define SEND_TYPE_ARG3 size_t
  243. #endif
  244. /* ---------------------------------------------------------------- */
  245. /* Watt-32 tcp/ip SPECIFIC */
  246. /* ---------------------------------------------------------------- */
  247. #ifdef USE_WATT32
  248. #include <tcp.h>
  249. #undef byte
  250. #undef word
  251. #undef USE_WINSOCK
  252. #undef HAVE_WINSOCK2_H
  253. #undef HAVE_WS2TCPIP_H
  254. #define HAVE_SYS_IOCTL_H
  255. #define HAVE_SYS_SOCKET_H
  256. #define HAVE_NETINET_IN_H
  257. #define HAVE_NETDB_H
  258. #define HAVE_ARPA_INET_H
  259. #define SOCKET int
  260. #endif
  261. /* ---------------------------------------------------------------- */
  262. /* COMPILER SPECIFIC */
  263. /* ---------------------------------------------------------------- */
  264. /* Define to nothing if compiler does not support 'const' qualifier. */
  265. /* #define const */
  266. /* Define to nothing if compiler does not support 'volatile' qualifier. */
  267. /* #define volatile */
  268. /* Windows should not have HAVE_GMTIME_R defined */
  269. /* #undef HAVE_GMTIME_R */
  270. /* Define if the compiler supports the 'long long' data type. */
  271. #if (defined(_MSC_VER) && (_MSC_VER >= 1310)) || defined(__MINGW32__)
  272. #define HAVE_LONGLONG 1
  273. #endif
  274. /* Define to avoid VS2005 complaining about portable C functions. */
  275. #if defined(_MSC_VER) && (_MSC_VER >= 1400)
  276. #define _CRT_SECURE_NO_DEPRECATE 1
  277. #define _CRT_NONSTDC_NO_DEPRECATE 1
  278. #endif
  279. /* mingw-w64 and visual studio >= 2005 (MSVCR80)
  280. all default to 64-bit time_t unless _USE_32BIT_TIME_T is defined */
  281. #if (defined(_MSC_VER) && (_MSC_VER >= 1400)) || defined(__MINGW32__)
  282. # ifndef _USE_32BIT_TIME_T
  283. # define SIZEOF_TIME_T 8
  284. # else
  285. # define SIZEOF_TIME_T 4
  286. # endif
  287. #endif
  288. /* Define some minimum and default build targets for Visual Studio */
  289. #if defined(_MSC_VER)
  290. /* Officially, Microsoft's Windows SDK versions 6.X does not support Windows
  291. 2000 as a supported build target. VS2008 default installations provides
  292. an embedded Windows SDK v6.0A along with the claim that Windows 2000 is a
  293. valid build target for VS2008. Popular belief is that binaries built with
  294. VS2008 using Windows SDK versions v6.X and Windows 2000 as a build target
  295. are functional. */
  296. # define VS2008_MIN_TARGET 0x0500
  297. /* The minimum build target for VS2012 is Vista unless Update 1 is installed
  298. and the v110_xp toolset is chosen. */
  299. # if defined(_USING_V110_SDK71_)
  300. # define VS2012_MIN_TARGET 0x0501
  301. # else
  302. # define VS2012_MIN_TARGET 0x0600
  303. # endif
  304. /* VS2008 default build target is Windows Vista. We override default target
  305. to be Windows XP. */
  306. # define VS2008_DEF_TARGET 0x0501
  307. /* VS2012 default build target is Windows Vista unless Update 1 is installed
  308. and the v110_xp toolset is chosen. */
  309. # if defined(_USING_V110_SDK71_)
  310. # define VS2012_DEF_TARGET 0x0501
  311. # else
  312. # define VS2012_DEF_TARGET 0x0600
  313. # endif
  314. #endif
  315. /* VS2008 default target settings and minimum build target check. */
  316. #if defined(_MSC_VER) && (_MSC_VER >= 1500) && (_MSC_VER <= 1600)
  317. # ifndef _WIN32_WINNT
  318. # define _WIN32_WINNT VS2008_DEF_TARGET
  319. # endif
  320. # ifndef WINVER
  321. # define WINVER VS2008_DEF_TARGET
  322. # endif
  323. # if (_WIN32_WINNT < VS2008_MIN_TARGET) || (WINVER < VS2008_MIN_TARGET)
  324. # error VS2008 does not support Windows build targets prior to Windows 2000
  325. # endif
  326. #endif
  327. /* VS2012 default target settings and minimum build target check. */
  328. #if defined(_MSC_VER) && (_MSC_VER >= 1700)
  329. # ifndef _WIN32_WINNT
  330. # define _WIN32_WINNT VS2012_DEF_TARGET
  331. # endif
  332. # ifndef WINVER
  333. # define WINVER VS2012_DEF_TARGET
  334. # endif
  335. # if (_WIN32_WINNT < VS2012_MIN_TARGET) || (WINVER < VS2012_MIN_TARGET)
  336. # if defined(_USING_V110_SDK71_)
  337. # error VS2012 does not support Windows build targets prior to Windows XP
  338. # else
  339. # error VS2012 does not support Windows build targets prior to Windows \
  340. Vista
  341. # endif
  342. # endif
  343. #endif
  344. /* Windows XP is required for freeaddrinfo, getaddrinfo */
  345. #define HAVE_FREEADDRINFO 1
  346. #define HAVE_GETADDRINFO 1
  347. #define HAVE_GETADDRINFO_THREADSAFE 1
  348. /* ---------------------------------------------------------------- */
  349. /* STRUCT RELATED */
  350. /* ---------------------------------------------------------------- */
  351. /* Define if you have struct sockaddr_storage. */
  352. #define HAVE_STRUCT_SOCKADDR_STORAGE 1
  353. /* Define if you have struct timeval. */
  354. #define HAVE_STRUCT_TIMEVAL 1
  355. /* Define if struct sockaddr_in6 has the sin6_scope_id member. */
  356. #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
  357. /* ---------------------------------------------------------------- */
  358. /* LARGE FILE SUPPORT */
  359. /* ---------------------------------------------------------------- */
  360. #if defined(_MSC_VER) && !defined(_WIN32_WCE)
  361. # if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
  362. # define USE_WIN32_LARGE_FILES
  363. # else
  364. # define USE_WIN32_SMALL_FILES
  365. # endif
  366. #endif
  367. #if defined(__MINGW32__) && !defined(USE_WIN32_LARGE_FILES)
  368. # define USE_WIN32_LARGE_FILES
  369. #endif
  370. #if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
  371. # define USE_WIN32_SMALL_FILES
  372. #endif
  373. /* Number of bits in a file offset, on hosts where this is settable. */
  374. #if defined(USE_WIN32_LARGE_FILES) && defined(__MINGW32__)
  375. # ifndef _FILE_OFFSET_BITS
  376. # define _FILE_OFFSET_BITS 64
  377. # endif
  378. #endif
  379. #ifdef USE_WIN32_LARGE_FILES
  380. #define HAVE__FSEEKI64
  381. #endif
  382. /* Define to the size of `off_t', as computed by sizeof. */
  383. #if defined(__MINGW32__) && \
  384. defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
  385. # define SIZEOF_OFF_T 8
  386. #else
  387. # define SIZEOF_OFF_T 4
  388. #endif
  389. /* ---------------------------------------------------------------- */
  390. /* DNS RESOLVER SPECIALTY */
  391. /* ---------------------------------------------------------------- */
  392. /*
  393. * Undefine both USE_ARES and USE_THREADS_WIN32 for synchronous DNS.
  394. */
  395. /* Define to enable c-ares asynchronous DNS lookups. */
  396. /* #define USE_ARES 1 */
  397. /* Default define to enable threaded asynchronous DNS lookups. */
  398. #if !defined(USE_SYNC_DNS) && !defined(USE_ARES) && \
  399. !defined(USE_THREADS_WIN32)
  400. # define USE_THREADS_WIN32 1
  401. #endif
  402. #if defined(USE_ARES) && defined(USE_THREADS_WIN32)
  403. # error "Only one DNS lookup specialty may be defined at most"
  404. #endif
  405. /* ---------------------------------------------------------------- */
  406. /* LDAP SUPPORT */
  407. /* ---------------------------------------------------------------- */
  408. #if defined(CURL_HAS_NOVELL_LDAPSDK)
  409. #undef USE_WIN32_LDAP
  410. #define HAVE_LDAP_SSL_H 1
  411. #define HAVE_LDAP_URL_PARSE 1
  412. #elif defined(CURL_HAS_OPENLDAP_LDAPSDK)
  413. #undef USE_WIN32_LDAP
  414. #define HAVE_LDAP_URL_PARSE 1
  415. #else
  416. #undef HAVE_LDAP_URL_PARSE
  417. #define HAVE_LDAP_SSL 1
  418. #define USE_WIN32_LDAP 1
  419. #endif
  420. /* Define to use the Windows crypto library. */
  421. #if !defined(CURL_WINDOWS_APP)
  422. #define USE_WIN32_CRYPTO
  423. #endif
  424. /* Define to use Unix sockets. */
  425. #define USE_UNIX_SOCKETS
  426. /* ---------------------------------------------------------------- */
  427. /* ADDITIONAL DEFINITIONS */
  428. /* ---------------------------------------------------------------- */
  429. /* Define cpu-machine-OS */
  430. #ifndef OS
  431. #if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */
  432. #define OS "i386-pc-win32"
  433. #elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (MSVC >=2005 or gcc) */
  434. #define OS "x86_64-pc-win32"
  435. #elif defined(_M_IA64) || defined(__ia64__) /* Itanium */
  436. #define OS "ia64-pc-win32"
  437. #elif defined(_M_ARM_NT) || defined(__arm__) /* ARMv7-Thumb2 (Windows RT) */
  438. #define OS "thumbv7a-pc-win32"
  439. #elif defined(_M_ARM64) || defined(__aarch64__) /* ARM64 (Windows 10) */
  440. #define OS "aarch64-pc-win32"
  441. #else
  442. #define OS "unknown-pc-win32"
  443. #endif
  444. #endif
  445. /* Name of package */
  446. #define PACKAGE "curl"
  447. /* If you want to build curl with the built-in manual */
  448. #define USE_MANUAL 1
  449. #if defined(USE_IPV6)
  450. # define ENABLE_IPV6 1
  451. #endif
  452. #endif /* HEADER_CURL_CONFIG_WIN32_H */