1
0
mirror of https://frontier.innolan.net/rainlance/c-ares.git synced 2025-10-06 17:49:48 +00:00

Test for USE_WINSOCK since it is more restrictive than WIN32

This commit is contained in:
Yang Tse
2009-11-09 12:57:26 +00:00
parent 91031e8ce4
commit 39c0bac44c
3 changed files with 8 additions and 8 deletions

View File

@ -18,7 +18,7 @@
#include "ares_setup.h" #include "ares_setup.h"
#if defined(WIN32) && !defined(WATT32) #ifdef USE_WINSOCK
#include <iphlpapi.h> #include <iphlpapi.h>
#endif #endif

View File

@ -24,7 +24,7 @@
/* library-private global and unique instance vars */ /* library-private global and unique instance vars */
#ifdef WIN32 #ifdef USE_WINSOCK
fpGetNetworkParams_t fpGetNetworkParams = ZERO_NULL; fpGetNetworkParams_t fpGetNetworkParams = ZERO_NULL;
fpSystemFunction036_t fpSystemFunction036 = ZERO_NULL; fpSystemFunction036_t fpSystemFunction036 = ZERO_NULL;
#endif #endif
@ -34,7 +34,7 @@ fpSystemFunction036_t fpSystemFunction036 = ZERO_NULL;
static unsigned int ares_initialized; static unsigned int ares_initialized;
static int ares_init_flags; static int ares_init_flags;
#ifdef WIN32 #ifdef USE_WINSOCK
static HMODULE hnd_iphlpapi; static HMODULE hnd_iphlpapi;
static HMODULE hnd_advapi32; static HMODULE hnd_advapi32;
#endif #endif
@ -42,7 +42,7 @@ static HMODULE hnd_advapi32;
static int ares_win32_init(void) static int ares_win32_init(void)
{ {
#ifdef WIN32 #ifdef USE_WINSOCK
hnd_iphlpapi = 0; hnd_iphlpapi = 0;
hnd_iphlpapi = LoadLibrary("iphlpapi.dll"); hnd_iphlpapi = LoadLibrary("iphlpapi.dll");
@ -78,7 +78,7 @@ static int ares_win32_init(void)
static void ares_win32_cleanup(void) static void ares_win32_cleanup(void)
{ {
#ifdef WIN32 #ifdef USE_WINSOCK
if (hnd_advapi32) if (hnd_advapi32)
FreeLibrary(hnd_advapi32); FreeLibrary(hnd_advapi32);
if (hnd_iphlpapi) if (hnd_iphlpapi)
@ -123,7 +123,7 @@ void ares_library_cleanup(void)
int ares_library_initialized(void) int ares_library_initialized(void)
{ {
#ifdef WIN32 #ifdef USE_WINSOCK
if (!ares_initialized) if (!ares_initialized)
return ARES_ENOTINITIALIZED; return ARES_ENOTINITIALIZED;
#endif #endif

View File

@ -21,7 +21,7 @@
#include "ares_setup.h" #include "ares_setup.h"
#ifdef WIN32 #ifdef USE_WINSOCK
#include <iphlpapi.h> #include <iphlpapi.h>
@ -34,7 +34,7 @@ typedef BOOLEAN (APIENTRY *fpSystemFunction036_t) (void*, ULONG);
extern fpGetNetworkParams_t fpGetNetworkParams; extern fpGetNetworkParams_t fpGetNetworkParams;
extern fpSystemFunction036_t fpSystemFunction036; extern fpSystemFunction036_t fpSystemFunction036;
#endif /* WIN32 */ #endif /* USE_WINSOCK */
#endif /* HEADER_CARES_LIBRARY_INIT_H */ #endif /* HEADER_CARES_LIBRARY_INIT_H */