Renamed fpGetNetworkParams and fpSystemFunction036 to avoid namespace pollution with static library

pull/1/head
Yang Tse 15 years ago
parent c91a177d71
commit ea29eeb4eb
  1. 8
      ares_init.c
  2. 10
      ares_library_init.c
  3. 4
      ares_library_init.h

@ -581,7 +581,7 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
if (!fi) if (!fi)
return 0; return 0;
res = (*fpGetNetworkParams) (fi, &size); res = (*ares_fpGetNetworkParams) (fi, &size);
if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS)) if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS))
goto quit; goto quit;
@ -590,7 +590,7 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
goto quit; goto quit;
fi = newfi; fi = newfi;
res = (*fpGetNetworkParams) (fi, &size); res = (*ares_fpGetNetworkParams) (fi, &size);
if (res != ERROR_SUCCESS) if (res != ERROR_SUCCESS)
goto quit; goto quit;
@ -1503,9 +1503,9 @@ static void randomize_key(unsigned char* key,int key_data_len)
int counter=0; int counter=0;
#ifdef WIN32 #ifdef WIN32
BOOLEAN res; BOOLEAN res;
if (fpSystemFunction036) if (ares_fpSystemFunction036)
{ {
res = (*fpSystemFunction036) (key, key_data_len); res = (*ares_fpSystemFunction036) (key, key_data_len);
if (res) if (res)
randomized = 1; randomized = 1;
} }

@ -25,8 +25,8 @@
/* library-private global and unique instance vars */ /* library-private global and unique instance vars */
#ifdef USE_WINSOCK #ifdef USE_WINSOCK
fpGetNetworkParams_t fpGetNetworkParams = ZERO_NULL; fpGetNetworkParams_t ares_fpGetNetworkParams = ZERO_NULL;
fpSystemFunction036_t fpSystemFunction036 = ZERO_NULL; fpSystemFunction036_t ares_fpSystemFunction036 = ZERO_NULL;
#endif #endif
/* library-private global vars with source visibility restricted to this file */ /* library-private global vars with source visibility restricted to this file */
@ -49,9 +49,9 @@ static int ares_win32_init(void)
if (!hnd_iphlpapi) if (!hnd_iphlpapi)
return ARES_ELOADIPHLPAPI; return ARES_ELOADIPHLPAPI;
fpGetNetworkParams = (fpGetNetworkParams_t) ares_fpGetNetworkParams = (fpGetNetworkParams_t)
GetProcAddress(hnd_iphlpapi, "GetNetworkParams"); GetProcAddress(hnd_iphlpapi, "GetNetworkParams");
if (!fpGetNetworkParams) if (!ares_fpGetNetworkParams)
{ {
FreeLibrary(hnd_iphlpapi); FreeLibrary(hnd_iphlpapi);
return ARES_EADDRGETNETWORKPARAMS; return ARES_EADDRGETNETWORKPARAMS;
@ -67,7 +67,7 @@ static int ares_win32_init(void)
hnd_advapi32 = LoadLibrary("advapi32.dll"); hnd_advapi32 = LoadLibrary("advapi32.dll");
if (hnd_advapi32) if (hnd_advapi32)
{ {
fpSystemFunction036 = (fpSystemFunction036_t) ares_fpSystemFunction036 = (fpSystemFunction036_t)
GetProcAddress(hnd_advapi32, "SystemFunction036"); GetProcAddress(hnd_advapi32, "SystemFunction036");
} }

@ -31,8 +31,8 @@ typedef BOOLEAN (APIENTRY *fpSystemFunction036_t) (void*, ULONG);
/* Forward-declaration of variables defined in ares_library_init.c */ /* Forward-declaration of variables defined in ares_library_init.c */
/* that are global and unique instances for whole c-ares library. */ /* that are global and unique instances for whole c-ares library. */
extern fpGetNetworkParams_t fpGetNetworkParams; extern fpGetNetworkParams_t ares_fpGetNetworkParams;
extern fpSystemFunction036_t fpSystemFunction036; extern fpSystemFunction036_t ares_fpSystemFunction036;
#endif /* USE_WINSOCK */ #endif /* USE_WINSOCK */

Loading…
Cancel
Save