]> granicus.if.org Git - curl/commitdiff
Definitions of resolver specialty compile-time defines CURLRES_* moved
authorYang Tse <yangsita@gmail.com>
Fri, 22 Jan 2010 20:27:48 +0000 (20:27 +0000)
committerYang Tse <yangsita@gmail.com>
Fri, 22 Jan 2010 20:27:48 +0000 (20:27 +0000)
from hostip.h to setup.h in order to allow proper inclusion in any file.

This represents no functional change at all in which resolver is used,
everything still works as usual, internally and externally there is no
difference in behavior.

lib/hostip.h
lib/setup.h
lib/url.c
lib/urldata.h

index e987f301edefb344f74ff12e231f3abc5d601e70..85425b6cedf21f4fff3c688cc9a8aaaa7fc16fba 100644 (file)
 #endif
 
 /*
- * Setup comfortable CURLRES_* defines to use in the host*.c sources.
+ * Comfortable CURLRES_* definitions are included from setup.h
  */
 
 #ifdef USE_ARES
 #include <ares_version.h>
 #endif
 
-#ifdef USE_ARES
-#define CURLRES_ASYNCH
-#define CURLRES_ARES
-#endif
-
-#ifdef USE_THREADING_GETHOSTBYNAME
-#define CURLRES_ASYNCH
-#define CURLRES_THREADED
-#endif
-
-#ifdef USE_THREADING_GETADDRINFO
-#define CURLRES_ASYNCH
-#define CURLRES_THREADED
-#endif
-
-#ifdef ENABLE_IPV6
-#define CURLRES_IPV6
-#else
-#define CURLRES_IPV4
-#endif
-
-#ifndef CURLRES_ASYNCH
-#define CURLRES_SYNCH
-#endif
-
 /* Allocate enough memory to hold the full name information structs and
  * everything. OSF1 is known to require at least 8872 bytes. The buffer
  * required for storing all possible aliases and IP numbers is according to
index a8549a7d8c385ff724b80062b7251ce41b3dbc39..980a91699a2ea29dcb33ea8e444f6467d4245cfa 100644 (file)
 
 #endif /* WIN32 */
 
+/*
+ * msvc 6.0 requires PSDK in order to have INET6_ADDRSTRLEN
+ * defined in ws2tcpip.h as well as to provide IPv6 support.
+ */
+
+#if defined(_MSC_VER) && !defined(__POCC__)
+#  if !defined(HAVE_WS2TCPIP_H) || \
+     ((_MSC_VER < 1300) && !defined(INET6_ADDRSTRLEN))
+#    undef HAVE_GETADDRINFO_THREADSAFE
+#    undef HAVE_FREEADDRINFO
+#    undef HAVE_GETADDRINFO
+#    undef HAVE_GETNAMEINFO
+#    undef ENABLE_IPV6
+#  endif
+#endif
+
+/* ---------------------------------------------------------------- */
+/*             resolver specialty compile-time defines              */
+/*         CURLRES_* defines to use in the host*.c sources          */
+/* ---------------------------------------------------------------- */
+
 #if defined(WIN32) && !defined(__CYGWIN__) && !defined(USE_ARES) && \
     !defined(__LCC__)  /* lcc-win32 doesn't have _beginthreadex() */
 #ifdef ENABLE_IPV6
 #define CURL_NO__BEGINTHREADEX
 #endif
 
+#ifdef USE_ARES
+#  define CURLRES_ASYNCH
+#  define CURLRES_ARES
+#endif
+
+#ifdef USE_THREADING_GETHOSTBYNAME
+#  define CURLRES_ASYNCH
+#  define CURLRES_THREADED
+#endif
+
+#ifdef USE_THREADING_GETADDRINFO
+#  define CURLRES_ASYNCH
+#  define CURLRES_THREADED
+#endif
+
+#ifdef ENABLE_IPV6
+#  define CURLRES_IPV6
+#else
+#  define CURLRES_IPV4
+#endif
+
+#ifndef CURLRES_ASYNCH
+#  define CURLRES_SYNCH
+#endif
+
+/* ---------------------------------------------------------------- */
+
 /*
  * When using WINSOCK, TELNET protocol requires WINSOCK2 API.
  */
 #  endif
 #endif
 
-/*
- * msvc 6.0 requires PSDK in order to have INET6_ADDRSTRLEN
- * defined in ws2tcpip.h as well as to provide IPv6 support.
- */
-
-#if defined(_MSC_VER) && !defined(__POCC__)
-#  if !defined(HAVE_WS2TCPIP_H) || ((_MSC_VER < 1300) && !defined(INET6_ADDRSTRLEN))
-#    undef HAVE_FREEADDRINFO
-#    undef HAVE_GETADDRINFO
-#    undef HAVE_GETNAMEINFO
-#    undef ENABLE_IPV6
-#  endif
-#endif
-
 /*
  * Intentionally fail to build when using msvc 6.0 without PSDK installed.
  * The brave of heart can circumvent this, defining ALLOW_MSVC6_WITHOUT_PSDK
index f3ac14d5c503ec9248251faf7c0db149a2f86396..927e16887d229552c29989b6fae3119909678f43 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -5044,8 +5044,7 @@ CURLcode Curl_connect(struct SessionHandle *data,
 CURLcode Curl_async_resolved(struct connectdata *conn,
                              bool *protocol_done)
 {
-#if defined(USE_ARES) || defined(USE_THREADING_GETHOSTBYNAME) || \
-    defined(USE_THREADING_GETADDRINFO)
+#ifdef CURLRES_ASYNCH
   CURLcode code;
 
   if(conn->async.dns) {
index 8e3f612ce96e5155ee52d1573464dc15ba111cd5..f02bfc43dc960a3bdceead87632324524b3f4515 100644 (file)
@@ -436,8 +436,7 @@ typedef enum {
 } zlibInitState;
 #endif
 
-#if defined(USE_ARES) || defined(USE_THREADING_GETHOSTBYNAME) || \
-    defined(USE_THREADING_GETADDRINFO)
+#ifdef CURLRES_ASYNCH
 struct Curl_async {
   char *hostname;
   int port;
@@ -813,8 +812,7 @@ struct connectdata {
 
   char syserr_buf [256]; /* buffer for Curl_strerror() */
 
-#if defined(USE_ARES) || defined(USE_THREADING_GETHOSTBYNAME) || \
-    defined(USE_THREADING_GETADDRINFO)
+#ifdef CURLRES_ASYNCH
   /* data used for the asynch name resolve callback */
   struct Curl_async async;
 #endif