]> granicus.if.org Git - curl/commitdiff
resolvers: only include anything if needed
authorMarcel Raad <Marcel.Raad@teamviewer.com>
Thu, 26 Oct 2017 18:52:22 +0000 (20:52 +0200)
committerMarcel Raad <Marcel.Raad@teamviewer.com>
Fri, 27 Oct 2017 11:20:13 +0000 (13:20 +0200)
This avoids warnings about unused stuff.

Closes https://github.com/curl/curl/pull/2023

lib/asyn-ares.c
lib/hostasyn.c
lib/hostip4.c
lib/hostip6.c
lib/hostsyn.c

index 27523041edf38fc5f1f310e11c8c8ffcbf736049..dd7dc4028bb1f07a8b85ac2ca9562b94decc96fc 100644 (file)
 
 #include "curl_setup.h"
 
+/***********************************************************************
+ * Only for ares-enabled builds
+ * And only for functions that fulfill the asynch resolver backend API
+ * as defined in asyn.h, nothing else belongs in this file!
+ **********************************************************************/
+
+#ifdef CURLRES_ARES
+
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif
 #define in_addr_t unsigned long
 #endif
 
-/***********************************************************************
- * Only for ares-enabled builds
- * And only for functions that fulfill the asynch resolver backend API
- * as defined in asyn.h, nothing else belongs in this file!
- **********************************************************************/
-
-#ifdef CURLRES_ARES
-
 #include "urldata.h"
 #include "sendf.h"
 #include "hostip.h"
index 28bdf7a48ab884e535f5e7c8934ee3651844c02c..7b6e8568a0275268c52d955f23f33694345861a5 100644 (file)
 
 #include "curl_setup.h"
 
+/***********************************************************************
+ * Only for builds using asynchronous name resolves
+ **********************************************************************/
+#ifdef CURLRES_ASYNCH
+
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
 /* The last #include file should be: */
 #include "memdebug.h"
 
-/***********************************************************************
- * Only for builds using asynchronous name resolves
- **********************************************************************/
-#ifdef CURLRES_ASYNCH
-
 /*
  * Curl_addrinfo_callback() gets called by ares, gethostbyname_thread()
  * or getaddrinfo_thread() when we got the name resolved (or not!).
index 6a7c6e5767760918dc82a55a0b6bdcf99651f9cc..9d6f115ae64e0ca6c5c46c1743345a1ebb264efb 100644 (file)
 
 #include "curl_setup.h"
 
+/***********************************************************************
+ * Only for plain IPv4 builds
+ **********************************************************************/
+#ifdef CURLRES_IPV4 /* plain IPv4 code coming up */
+
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
 #include "curl_memory.h"
 #include "memdebug.h"
 
-/***********************************************************************
- * Only for plain IPv4 builds
- **********************************************************************/
-#ifdef CURLRES_IPV4 /* plain IPv4 code coming up */
 /*
  * Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've
  * been set and returns TRUE if they are OK.
index edeebec9e2d817f99a73f4bb7cb0ccaedd7b29a1..7c9988f41ba89bc21a175e2b308567080f2b1fb2 100644 (file)
 
 #include "curl_setup.h"
 
+/***********************************************************************
+ * Only for IPv6-enabled builds
+ **********************************************************************/
+#ifdef CURLRES_IPV6
+
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
 #include "curl_memory.h"
 #include "memdebug.h"
 
-/***********************************************************************
- * Only for IPv6-enabled builds
- **********************************************************************/
-#ifdef CURLRES_IPV6
-
 #if defined(CURLDEBUG) && defined(HAVE_GETNAMEINFO)
 /* These are strictly for memory tracing and are using the same style as the
  * family otherwise present in memdebug.c. I put these ones here since they
index 1a95263c625ff64acc8fb89c6750289b96f9c408..3de6746f523f59d57fe6ad860ee25b2fe8bddfb4 100644 (file)
 
 #include "curl_setup.h"
 
+/***********************************************************************
+ * Only for builds using synchronous name resolves
+ **********************************************************************/
+#ifdef CURLRES_SYNCH
+
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
 /* The last #include file should be: */
 #include "memdebug.h"
 
-/***********************************************************************
- * Only for builds using synchronous name resolves
- **********************************************************************/
-#ifdef CURLRES_SYNCH
-
 /*
  * Function provided by the resolver backend to set DNS servers to use.
  */