config-win32.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. #ifndef HEADER_CARES_CONFIG_WIN32_H
  2. #define HEADER_CARES_CONFIG_WIN32_H
  3. /* Copyright (C) 2004 - 2011 by Daniel Stenberg et al
  4. *
  5. * Permission to use, copy, modify, and distribute this software and its
  6. * documentation for any purpose and without fee is hereby granted, provided
  7. * that the above copyright notice appear in all copies and that both that
  8. * copyright notice and this permission notice appear in supporting
  9. * documentation, and that the name of M.I.T. not be used in advertising or
  10. * publicity pertaining to distribution of the software without specific,
  11. * written prior permission. M.I.T. makes no representations about the
  12. * suitability of this software for any purpose. It is provided "as is"
  13. * without express or implied warranty.
  14. */
  15. /* ================================================================ */
  16. /* c-ares/config-win32.h - Hand crafted config file for Windows */
  17. /* ================================================================ */
  18. /* ---------------------------------------------------------------- */
  19. /* HEADER FILES */
  20. /* ---------------------------------------------------------------- */
  21. /* Define if you have the <assert.h> header file. */
  22. #define HAVE_ASSERT_H 1
  23. /* Define if you have the <errno.h> header file. */
  24. #define HAVE_ERRNO_H 1
  25. /* Define if you have the <getopt.h> header file. */
  26. #if defined(__MINGW32__) || defined(__POCC__)
  27. #define HAVE_GETOPT_H 1
  28. #endif
  29. /* Define if you have the <limits.h> header file. */
  30. #define HAVE_LIMITS_H 1
  31. /* Define if you have the <process.h> header file. */
  32. #ifndef __SALFORDC__
  33. #define HAVE_PROCESS_H 1
  34. #endif
  35. /* Define if you have the <signal.h> header file. */
  36. #define HAVE_SIGNAL_H 1
  37. /* Define if you have the <sys/time.h> header file */
  38. /* #define HAVE_SYS_TIME_H 1 */
  39. /* Define if you have the <time.h> header file. */
  40. #define HAVE_TIME_H 1
  41. /* Define if you have the <unistd.h> header file. */
  42. #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \
  43. defined(__POCC__)
  44. #define HAVE_UNISTD_H 1
  45. #endif
  46. /* Define if you have the <windows.h> header file. */
  47. #define HAVE_WINDOWS_H 1
  48. /* Define if you have the <winsock.h> header file. */
  49. #define HAVE_WINSOCK_H 1
  50. /* Define if you have the <winsock2.h> header file. */
  51. #ifndef __SALFORDC__
  52. #define HAVE_WINSOCK2_H 1
  53. #endif
  54. /* Define if you have the <ws2tcpip.h> header file. */
  55. #ifndef __SALFORDC__
  56. #define HAVE_WS2TCPIP_H 1
  57. #endif
  58. /* Define to 1 if you have the <sys/uio.h> header file. */
  59. #define HAVE_SYS_UIO_H 1
  60. /* Define to 1 if you have the writev function. */
  61. #define HAVE_WRITEV 1
  62. /* ---------------------------------------------------------------- */
  63. /* OTHER HEADER INFO */
  64. /* ---------------------------------------------------------------- */
  65. /* Define if sig_atomic_t is an available typedef. */
  66. #define HAVE_SIG_ATOMIC_T 1
  67. /* Define if you have the ANSI C header files. */
  68. #define STDC_HEADERS 1
  69. /* Define if you can safely include both <sys/time.h> and <time.h>. */
  70. /* #define TIME_WITH_SYS_TIME 1 */
  71. /* ---------------------------------------------------------------- */
  72. /* FUNCTIONS */
  73. /* ---------------------------------------------------------------- */
  74. /* Define if you have the closesocket function. */
  75. #define HAVE_CLOSESOCKET 1
  76. /* Define if you have the getenv function. */
  77. #define HAVE_GETENV 1
  78. /* Define if you have the gethostname function. */
  79. #define HAVE_GETHOSTNAME 1
  80. /* Define if you have the ioctlsocket function. */
  81. #define HAVE_IOCTLSOCKET 1
  82. /* Define if you have a working ioctlsocket FIONBIO function. */
  83. #define HAVE_IOCTLSOCKET_FIONBIO 1
  84. /* Define if you have the strcasecmp function. */
  85. /* #define HAVE_STRCASECMP 1 */
  86. /* Define if you have the strdup function. */
  87. #define HAVE_STRDUP 1
  88. /* Define if you have the stricmp function. */
  89. #define HAVE_STRICMP 1
  90. /* Define if you have the strncasecmp function. */
  91. /* #define HAVE_STRNCASECMP 1 */
  92. /* Define if you have the strnicmp function. */
  93. #define HAVE_STRNICMP 1
  94. /* Define if you have the recv function. */
  95. #define HAVE_RECV 1
  96. /* Define to the type of arg 1 for recv. */
  97. #define RECV_TYPE_ARG1 SOCKET
  98. /* Define to the type of arg 2 for recv. */
  99. #define RECV_TYPE_ARG2 char *
  100. /* Define to the type of arg 3 for recv. */
  101. #define RECV_TYPE_ARG3 int
  102. /* Define to the type of arg 4 for recv. */
  103. #define RECV_TYPE_ARG4 int
  104. /* Define to the function return type for recv. */
  105. #define RECV_TYPE_RETV int
  106. /* Define if you have the recvfrom function. */
  107. #define HAVE_RECVFROM 1
  108. /* Define to the type of arg 1 for recvfrom. */
  109. #define RECVFROM_TYPE_ARG1 SOCKET
  110. /* Define to the type pointed by arg 2 for recvfrom. */
  111. #define RECVFROM_TYPE_ARG2 char
  112. /* Define to the type of arg 3 for recvfrom. */
  113. #define RECVFROM_TYPE_ARG3 int
  114. /* Define to the type of arg 4 for recvfrom. */
  115. #define RECVFROM_TYPE_ARG4 int
  116. /* Define to the type pointed by arg 5 for recvfrom. */
  117. #define RECVFROM_TYPE_ARG5 struct sockaddr
  118. /* Define to the type pointed by arg 6 for recvfrom. */
  119. #define RECVFROM_TYPE_ARG6 int
  120. /* Define to the function return type for recvfrom. */
  121. #define RECVFROM_TYPE_RETV int
  122. /* Define if you have the send function. */
  123. #define HAVE_SEND 1
  124. /* Define to the type of arg 1 for send. */
  125. #define SEND_TYPE_ARG1 SOCKET
  126. /* Define to the type qualifier of arg 2 for send. */
  127. #define SEND_QUAL_ARG2 const
  128. /* Define to the type of arg 2 for send. */
  129. #define SEND_TYPE_ARG2 char *
  130. /* Define to the type of arg 3 for send. */
  131. #define SEND_TYPE_ARG3 int
  132. /* Define to the type of arg 4 for send. */
  133. #define SEND_TYPE_ARG4 int
  134. /* Define to the function return type for send. */
  135. #define SEND_TYPE_RETV int
  136. /* Specifics for the Watt-32 tcp/ip stack. */
  137. #ifdef WATT32
  138. #define SOCKET int
  139. #define NS_INADDRSZ 4
  140. #define HAVE_ARPA_NAMESER_H 1
  141. #define HAVE_ARPA_INET_H 1
  142. #define HAVE_NETDB_H 1
  143. #define HAVE_NETINET_IN_H 1
  144. #define HAVE_SYS_SOCKET_H 1
  145. #define HAVE_NETINET_TCP_H 1
  146. #define HAVE_AF_INET6 1
  147. #define HAVE_PF_INET6 1
  148. #define HAVE_STRUCT_IN6_ADDR 1
  149. #define HAVE_STRUCT_SOCKADDR_IN6 1
  150. #undef HAVE_WINSOCK_H
  151. #undef HAVE_WINSOCK2_H
  152. #undef HAVE_WS2TCPIP_H
  153. #endif
  154. /* ---------------------------------------------------------------- */
  155. /* TYPEDEF REPLACEMENTS */
  156. /* ---------------------------------------------------------------- */
  157. /* Define if in_addr_t is not an available 'typedefed' type. */
  158. #define in_addr_t unsigned long
  159. /* Define to the return type of signal handlers (int or void). */
  160. #define RETSIGTYPE void
  161. #ifdef __cplusplus
  162. /* Compiling headers in C++ mode means bool is available */
  163. #define HAVE_BOOL_T
  164. #endif
  165. /* ---------------------------------------------------------------- */
  166. /* TYPE SIZES */
  167. /* ---------------------------------------------------------------- */
  168. /* ---------------------------------------------------------------- */
  169. /* STRUCT RELATED */
  170. /* ---------------------------------------------------------------- */
  171. /* Define if you have struct addrinfo. */
  172. #define HAVE_STRUCT_ADDRINFO 1
  173. /* Define if you have struct sockaddr_storage. */
  174. #if !defined(__SALFORDC__) && !defined(__BORLANDC__)
  175. #define HAVE_STRUCT_SOCKADDR_STORAGE 1
  176. #endif
  177. /* Define if you have struct timeval. */
  178. #define HAVE_STRUCT_TIMEVAL 1
  179. /* ---------------------------------------------------------------- */
  180. /* COMPILER SPECIFIC */
  181. /* ---------------------------------------------------------------- */
  182. /* Define to avoid VS2005 complaining about portable C functions. */
  183. #if defined(_MSC_VER) && (_MSC_VER >= 1400)
  184. # define _CRT_SECURE_NO_DEPRECATE 1
  185. # define _CRT_NONSTDC_NO_DEPRECATE 1
  186. #endif
  187. /* Set the Target to Vista. However, any symbols required above Win2000
  188. * should be loaded via LoadLibrary() */
  189. #if defined(_MSC_VER) && (_MSC_VER >= 1500)
  190. # define VS2008_MIN_TARGET 0x0600
  191. #endif
  192. /* VS2008 default target settings and minimum build target check. */
  193. #if defined(_MSC_VER) && (_MSC_VER >= 1500)
  194. # ifndef _WIN32_WINNT
  195. # define _WIN32_WINNT VS2008_MIN_TARGET
  196. # endif
  197. # ifndef WINVER
  198. # define WINVER VS2008_MIN_TARGET
  199. # endif
  200. # if (_WIN32_WINNT < VS2008_MIN_TARGET) || (WINVER < VS2008_MIN_TARGET)
  201. # error VS2008 does not support Windows build targets prior to Windows 2000
  202. # endif
  203. #endif
  204. /* When no build target is specified Pelles C 5.00 and later default build
  205. target is Windows Vista. */
  206. #if defined(__POCC__) && (__POCC__ >= 500)
  207. # ifndef _WIN32_WINNT
  208. # define _WIN32_WINNT 0x0600
  209. # endif
  210. # ifndef WINVER
  211. # define WINVER 0x0600
  212. # endif
  213. #endif
  214. /* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is
  215. quite convoluted, compiler dependent and even build target dependent. */
  216. #if defined(HAVE_WS2TCPIP_H)
  217. # if defined(__POCC__)
  218. # define HAVE_FREEADDRINFO 1
  219. # define HAVE_GETADDRINFO 1
  220. # define HAVE_GETNAMEINFO 1
  221. # elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
  222. # define HAVE_FREEADDRINFO 1
  223. # define HAVE_GETADDRINFO 1
  224. # define HAVE_GETNAMEINFO 1
  225. # elif defined(_MSC_VER) && (_MSC_VER >= 1200)
  226. # define HAVE_FREEADDRINFO 1
  227. # define HAVE_GETADDRINFO 1
  228. # define HAVE_GETNAMEINFO 1
  229. # endif
  230. #endif
  231. #if defined(__POCC__)
  232. # ifndef _MSC_VER
  233. # error Microsoft extensions /Ze compiler option is required
  234. # endif
  235. # ifndef __POCC__OLDNAMES
  236. # error Compatibility names /Go compiler option is required
  237. # endif
  238. #endif
  239. /* ---------------------------------------------------------------- */
  240. /* IPV6 COMPATIBILITY */
  241. /* ---------------------------------------------------------------- */
  242. /* Define if you have address family AF_INET6. */
  243. #ifdef HAVE_WINSOCK2_H
  244. #define HAVE_AF_INET6 1
  245. #endif
  246. /* Define if you have protocol family PF_INET6. */
  247. #ifdef HAVE_WINSOCK2_H
  248. #define HAVE_PF_INET6 1
  249. #endif
  250. /* Define if you have struct in6_addr. */
  251. #ifdef HAVE_WS2TCPIP_H
  252. #define HAVE_STRUCT_IN6_ADDR 1
  253. #endif
  254. /* Define if you have struct sockaddr_in6. */
  255. #ifdef HAVE_WS2TCPIP_H
  256. #define HAVE_STRUCT_SOCKADDR_IN6 1
  257. #endif
  258. /* Define if you have sockaddr_in6 with scopeid. */
  259. #ifdef HAVE_WS2TCPIP_H
  260. #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
  261. #endif
  262. /* ---------------------------------------------------------------- */
  263. /* Win CE */
  264. /* ---------------------------------------------------------------- */
  265. /* FIXME: A proper config-win32ce.h should be created to hold these */
  266. /*
  267. * System error codes for Windows CE
  268. */
  269. #if defined(_WIN32_WCE) && !defined(HAVE_ERRNO_H)
  270. # define ENOENT ERROR_FILE_NOT_FOUND
  271. # define ESRCH ERROR_PATH_NOT_FOUND
  272. # define ENOMEM ERROR_NOT_ENOUGH_MEMORY
  273. # define ENOSPC ERROR_INVALID_PARAMETER
  274. #endif
  275. #endif /* HEADER_CARES_CONFIG_WIN32_H */