diff --git a/ares/ares_init.c b/ares/ares_init.c
index f7973f14e31c22006ab5b5b30b40b328420d7fa8..b2837901db639d4082ac6838dc1cca856fe4fc47 100644
--- a/ares/ares_init.c
+++ b/ares/ares_init.c
@@ -18,7 +18,7 @@
 
 #include "ares_setup.h"
 
-#if defined(WIN32) && !defined(WATT32)
+#ifdef USE_WINSOCK
 #include <iphlpapi.h>
 #endif
 
diff --git a/ares/ares_library_init.c b/ares/ares_library_init.c
index a2486ac7050933833620e726f9eb7dfcc06460b1..72a6ac9bc29d61630ece7f9cfbf88a93210832df 100644
--- a/ares/ares_library_init.c
+++ b/ares/ares_library_init.c
@@ -24,7 +24,7 @@
 
 /* library-private global and unique instance vars */
 
-#ifdef WIN32
+#ifdef USE_WINSOCK
 fpGetNetworkParams_t fpGetNetworkParams = ZERO_NULL;
 fpSystemFunction036_t fpSystemFunction036 = ZERO_NULL;
 #endif
@@ -34,7 +34,7 @@ fpSystemFunction036_t fpSystemFunction036 = ZERO_NULL;
 static unsigned int ares_initialized;
 static int          ares_init_flags;
 
-#ifdef WIN32
+#ifdef USE_WINSOCK
 static HMODULE hnd_iphlpapi;
 static HMODULE hnd_advapi32;
 #endif
@@ -42,7 +42,7 @@ static HMODULE hnd_advapi32;
 
 static int ares_win32_init(void)
 {
-#ifdef WIN32
+#ifdef USE_WINSOCK
 
   hnd_iphlpapi = 0;
   hnd_iphlpapi = LoadLibrary("iphlpapi.dll");
@@ -78,7 +78,7 @@ static int ares_win32_init(void)
 
 static void ares_win32_cleanup(void)
 {
-#ifdef WIN32
+#ifdef USE_WINSOCK
   if (hnd_advapi32)
     FreeLibrary(hnd_advapi32);
   if (hnd_iphlpapi)
@@ -123,7 +123,7 @@ void ares_library_cleanup(void)
 
 int ares_library_initialized(void)
 {
-#ifdef WIN32
+#ifdef USE_WINSOCK
   if (!ares_initialized)
     return ARES_ENOTINITIALIZED;
 #endif
diff --git a/ares/ares_library_init.h b/ares/ares_library_init.h
index d99a0bae17b1e112b5878ae2693719054c9444f1..dc8f11693e2deb75e169faaa0bad480cd6b9b3c8 100644
--- a/ares/ares_library_init.h
+++ b/ares/ares_library_init.h
@@ -21,7 +21,7 @@
 
 #include "ares_setup.h"
 
-#ifdef WIN32
+#ifdef USE_WINSOCK
 
 #include <iphlpapi.h>
 
@@ -34,7 +34,7 @@ typedef BOOLEAN (APIENTRY *fpSystemFunction036_t) (void*, ULONG);
 extern fpGetNetworkParams_t fpGetNetworkParams;
 extern fpSystemFunction036_t fpSystemFunction036;
 
-#endif /* WIN32 */
+#endif /* USE_WINSOCK */
 
 #endif /* HEADER_CARES_LIBRARY_INIT_H */