PageRenderTime 48ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 1ms

/deps/c-ares/config-win32.h

http://github.com/zpao/spidernode
C Header | 360 lines | 164 code | 79 blank | 117 comment | 18 complexity | e72d0e8b16a86dd3a00a46b93d193898 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, JSON, BSD-2-Clause, BSD-3-Clause
  1. #ifndef __ARES_CONFIG_WIN32_H
  2. #define __ARES_CONFIG_WIN32_H
  3. /* Copyright (C) 2004 - 2008 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. /* ares/config-win32.h - Hand crafted config file for Windows */
  17. /* ================================================================ */
  18. /* ---------------------------------------------------------------- */
  19. /* HEADER FILES */
  20. /* ---------------------------------------------------------------- */
  21. /* Define if you have the <getopt.h> header file. */
  22. #if defined(__MINGW32__) || defined(__POCC__)
  23. #define HAVE_GETOPT_H 1
  24. #endif
  25. /* Define if you have the <limits.h> header file. */
  26. #define HAVE_LIMITS_H 1
  27. /* Define if you have the <process.h> header file. */
  28. #ifndef __SALFORDC__
  29. #define HAVE_PROCESS_H 1
  30. #endif
  31. /* Define if you have the <signal.h> header file. */
  32. #define HAVE_SIGNAL_H 1
  33. /* Define if you have the <sys/time.h> header file */
  34. /* #define HAVE_SYS_TIME_H 1 */
  35. /* Define if you have the <time.h> header file. */
  36. #define HAVE_TIME_H 1
  37. /* Define if you have the <unistd.h> header file. */
  38. #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \
  39. defined(__POCC__)
  40. #define HAVE_UNISTD_H 1
  41. #endif
  42. /* Define if you have the <windows.h> header file. */
  43. #define HAVE_WINDOWS_H 1
  44. /* Define if you have the <winsock.h> header file. */
  45. #define HAVE_WINSOCK_H 1
  46. /* Define if you have the <winsock2.h> header file. */
  47. #ifndef __SALFORDC__
  48. #define HAVE_WINSOCK2_H 1
  49. #endif
  50. /* Define if you have the <ws2tcpip.h> header file. */
  51. #ifndef __SALFORDC__
  52. #define HAVE_WS2TCPIP_H 1
  53. #endif
  54. /* ---------------------------------------------------------------- */
  55. /* OTHER HEADER INFO */
  56. /* ---------------------------------------------------------------- */
  57. /* Define if sig_atomic_t is an available typedef. */
  58. #define HAVE_SIG_ATOMIC_T 1
  59. /* Define if you have the ANSI C header files. */
  60. #define STDC_HEADERS 1
  61. /* Define if you can safely include both <sys/time.h> and <time.h>. */
  62. /* #define TIME_WITH_SYS_TIME 1 */
  63. /* ---------------------------------------------------------------- */
  64. /* FUNCTIONS */
  65. /* ---------------------------------------------------------------- */
  66. /* Define if you have the closesocket function. */
  67. #define HAVE_CLOSESOCKET 1
  68. /* Define if you have the gethostname function. */
  69. #define HAVE_GETHOSTNAME 1
  70. /* Define if you have the ioctlsocket function. */
  71. #define HAVE_IOCTLSOCKET 1
  72. /* Define if you have a working ioctlsocket FIONBIO function. */
  73. #define HAVE_IOCTLSOCKET_FIONBIO 1
  74. /* Define if you have the strcasecmp function. */
  75. /* #define HAVE_STRCASECMP 1 */
  76. /* Define if you have the strdup function. */
  77. #define HAVE_STRDUP 1
  78. /* Define if you have the stricmp function. */
  79. #define HAVE_STRICMP 1
  80. /* Define if you have the strncasecmp function. */
  81. /* #define HAVE_STRNCASECMP 1 */
  82. /* Define if you have the strnicmp function. */
  83. #define HAVE_STRNICMP 1
  84. /* Define if you have the recv function. */
  85. #define HAVE_RECV 1
  86. /* Define to the type of arg 1 for recv. */
  87. #define RECV_TYPE_ARG1 SOCKET
  88. /* Define to the type of arg 2 for recv. */
  89. #define RECV_TYPE_ARG2 char *
  90. /* Define to the type of arg 3 for recv. */
  91. #define RECV_TYPE_ARG3 int
  92. /* Define to the type of arg 4 for recv. */
  93. #define RECV_TYPE_ARG4 int
  94. /* Define to the function return type for recv. */
  95. #define RECV_TYPE_RETV int
  96. /* Define if you have the recvfrom function. */
  97. #define HAVE_RECVFROM 1
  98. /* Define to the type of arg 1 for recvfrom. */
  99. #define RECVFROM_TYPE_ARG1 SOCKET
  100. /* Define to the type pointed by arg 2 for recvfrom. */
  101. #define RECVFROM_TYPE_ARG2 char
  102. /* Define to the type of arg 3 for recvfrom. */
  103. #define RECVFROM_TYPE_ARG3 int
  104. /* Define to the type of arg 4 for recvfrom. */
  105. #define RECVFROM_TYPE_ARG4 int
  106. /* Define to the type pointed by arg 5 for recvfrom. */
  107. #define RECVFROM_TYPE_ARG5 struct sockaddr
  108. /* Define to the type pointed by arg 6 for recvfrom. */
  109. #define RECVFROM_TYPE_ARG6 int
  110. /* Define to the function return type for recvfrom. */
  111. #define RECVFROM_TYPE_RETV int
  112. /* Define if you have the send function. */
  113. #define HAVE_SEND 1
  114. /* Define to the type of arg 1 for send. */
  115. #define SEND_TYPE_ARG1 SOCKET
  116. /* Define to the type qualifier of arg 2 for send. */
  117. #define SEND_QUAL_ARG2 const
  118. /* Define to the type of arg 2 for send. */
  119. #define SEND_TYPE_ARG2 char *
  120. /* Define to the type of arg 3 for send. */
  121. #define SEND_TYPE_ARG3 int
  122. /* Define to the type of arg 4 for send. */
  123. #define SEND_TYPE_ARG4 int
  124. /* Define to the function return type for send. */
  125. #define SEND_TYPE_RETV int
  126. /* Specifics for the Watt-32 tcp/ip stack */
  127. #ifdef WATT32
  128. #define SOCKET int
  129. #define NS_INADDRSZ 4
  130. #define HAVE_ARPA_NAMESER_H 1
  131. #define HAVE_ARPA_INET_H 1
  132. #define HAVE_NETDB_H 1
  133. #define HAVE_NETINET_IN_H 1
  134. #define HAVE_SYS_SOCKET_H 1
  135. #define HAVE_NETINET_TCP_H 1
  136. #define HAVE_AF_INET6 1
  137. #define HAVE_PF_INET6 1
  138. #define HAVE_STRUCT_IN6_ADDR 1
  139. #define HAVE_STRUCT_SOCKADDR_IN6 1
  140. #undef HAVE_WINSOCK_H
  141. #undef HAVE_WINSOCK2_H
  142. #undef HAVE_WS2TCPIP_H
  143. #endif
  144. /* ---------------------------------------------------------------- */
  145. /* TYPEDEF REPLACEMENTS */
  146. /* ---------------------------------------------------------------- */
  147. /* Define this if in_addr_t is not an available 'typedefed' type */
  148. #define in_addr_t unsigned long
  149. /* Define as the return type of signal handlers (int or void). */
  150. #define RETSIGTYPE void
  151. /* Define ssize_t if it is not an available 'typedefed' type */
  152. #ifndef _SSIZE_T_DEFINED
  153. # if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
  154. defined(__POCC__) || \
  155. defined(__MINGW32__)
  156. # elif defined(_WIN64)
  157. # define _SSIZE_T_DEFINED
  158. # define ssize_t __int64
  159. # else
  160. # define _SSIZE_T_DEFINED
  161. # define ssize_t int
  162. # endif
  163. #endif
  164. /* ---------------------------------------------------------------- */
  165. /* TYPE SIZES */
  166. /* ---------------------------------------------------------------- */
  167. /* The size of `int', as computed by sizeof. */
  168. #define SIZEOF_INT 4
  169. /* The size of `short', as computed by sizeof. */
  170. #define SIZEOF_SHORT 2
  171. /* The size of `size_t', as computed by sizeof. */
  172. #if defined(_WIN64)
  173. # define SIZEOF_SIZE_T 8
  174. #else
  175. # define SIZEOF_SIZE_T 4
  176. #endif
  177. /* ---------------------------------------------------------------- */
  178. /* STRUCT RELATED */
  179. /* ---------------------------------------------------------------- */
  180. /* Define this if you have struct addrinfo */
  181. #define HAVE_STRUCT_ADDRINFO 1
  182. /* Define this if you have struct sockaddr_storage */
  183. #ifndef __SALFORDC__
  184. #define HAVE_STRUCT_SOCKADDR_STORAGE 1
  185. #endif
  186. /* Define this if you have struct timeval */
  187. #define HAVE_STRUCT_TIMEVAL 1
  188. /* ---------------------------------------------------------------- */
  189. /* COMPILER SPECIFIC */
  190. /* ---------------------------------------------------------------- */
  191. /* Define to avoid VS2005 complaining about portable C functions */
  192. #if defined(_MSC_VER) && (_MSC_VER >= 1400)
  193. #define _CRT_SECURE_NO_DEPRECATE 1
  194. #define _CRT_NONSTDC_NO_DEPRECATE 1
  195. #endif
  196. /* Officially, Microsoft's Windows SDK versions 6.X do not support Windows
  197. 2000 as a supported build target. VS2008 default installations provide an
  198. embedded Windows SDK v6.0A along with the claim that Windows 2000 is a
  199. valid build target for VS2008. Popular belief is that binaries built using
  200. Windows SDK versions 6.X and Windows 2000 as a build target are functional */
  201. #if defined(_MSC_VER) && (_MSC_VER >= 1500)
  202. # define VS2008_MINIMUM_TARGET 0x0500
  203. #endif
  204. /* When no build target is specified VS2008 default build target is Windows
  205. Vista, which leaves out even Winsows XP. If no build target has been given
  206. for VS2008 we will target the minimum Officially supported build target,
  207. which happens to be Windows XP. */
  208. #if defined(_MSC_VER) && (_MSC_VER >= 1500)
  209. # define VS2008_DEFAULT_TARGET 0x0501
  210. #endif
  211. /* VS2008 default target settings and minimum build target check */
  212. #if defined(_MSC_VER) && (_MSC_VER >= 1500)
  213. # ifndef _WIN32_WINNT
  214. # define _WIN32_WINNT VS2008_DEFAULT_TARGET
  215. # endif
  216. # ifndef WINVER
  217. # define WINVER VS2008_DEFAULT_TARGET
  218. # endif
  219. # if (_WIN32_WINNT < VS2008_MINIMUM_TARGET) || (WINVER < VS2008_MINIMUM_TARGET)
  220. # error VS2008 does not support Windows build targets prior to Windows 2000
  221. # endif
  222. #endif
  223. /* When no build target is specified Pelles C 5.00 and later default build
  224. target is Windows Vista. We override default target to be Windows 2000. */
  225. #if defined(__POCC__) && (__POCC__ >= 500)
  226. # ifndef _WIN32_WINNT
  227. # define _WIN32_WINNT 0x0500
  228. # endif
  229. # ifndef WINVER
  230. # define WINVER 0x0500
  231. # endif
  232. #endif
  233. /* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is
  234. quite convoluted, compiler dependent and even build target dependent. */
  235. #if defined(HAVE_WS2TCPIP_H)
  236. # if defined(__POCC__)
  237. # define HAVE_FREEADDRINFO 1
  238. # define HAVE_GETADDRINFO 1
  239. # define HAVE_GETNAMEINFO 1
  240. # elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
  241. # define HAVE_FREEADDRINFO 1
  242. # define HAVE_GETADDRINFO 1
  243. # define HAVE_GETNAMEINFO 1
  244. # elif defined(_MSC_VER) && (_MSC_VER >= 1200)
  245. # define HAVE_FREEADDRINFO 1
  246. # define HAVE_GETADDRINFO 1
  247. # define HAVE_GETNAMEINFO 1
  248. # endif
  249. #endif
  250. #if defined(__POCC__)
  251. # ifndef _MSC_VER
  252. # error Microsoft extensions /Ze compiler option is required
  253. # endif
  254. # ifndef __POCC__OLDNAMES
  255. # error Compatibility names /Go compiler option is required
  256. # endif
  257. #endif
  258. /* ---------------------------------------------------------------- */
  259. /* IPV6 COMPATIBILITY */
  260. /* ---------------------------------------------------------------- */
  261. /* Define this if you have address family AF_INET6 */
  262. #ifdef HAVE_WINSOCK2_H
  263. #define HAVE_AF_INET6 1
  264. #endif
  265. /* Define this if you have protocol family PF_INET6 */
  266. #ifdef HAVE_WINSOCK2_H
  267. #define HAVE_PF_INET6 1
  268. #endif
  269. /* Define this if you have struct in6_addr */
  270. #ifdef HAVE_WS2TCPIP_H
  271. #define HAVE_STRUCT_IN6_ADDR 1
  272. #endif
  273. /* Define this if you have struct sockaddr_in6 */
  274. #ifdef HAVE_WS2TCPIP_H
  275. #define HAVE_STRUCT_SOCKADDR_IN6 1
  276. #endif
  277. /* Define this if you have sockaddr_in6 with scopeid */
  278. #ifdef HAVE_WS2TCPIP_H
  279. #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
  280. #endif
  281. #endif /* __ARES_CONFIG_WIN32_H */