1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

dns: fix compilation with MinGW from commit df69440d05

Avoid 'interface' literal that some MinGW versions define as a macro

Additionally, corrected some very, very minor coding style errors.
This commit is contained in:
Steve Holme 2013-09-17 20:59:43 +01:00
parent 8f5336a2fa
commit 158dfe2c5c
4 changed files with 17 additions and 10 deletions

View File

@ -625,15 +625,18 @@ CURLcode Curl_set_dns_servers(struct SessionHandle *data,
} }
CURLcode Curl_set_dns_interface(struct SessionHandle *data, CURLcode Curl_set_dns_interface(struct SessionHandle *data,
const char *interface) const char *interf)
{ {
#if (ARES_VERSION >= 0x010704) #if (ARES_VERSION >= 0x010704)
if(!interface) interface = ""; if(!interf)
ares_set_local_dev((ares_channel)data->state.resolver, interface); interf = "";
ares_set_local_dev((ares_channel)data->state.resolver, interf);
return CURLE_OK; return CURLE_OK;
#else /* c-ares version too old! */ #else /* c-ares version too old! */
(void)data; (void)data;
(void)interface; (void)interf;
return CURLE_NOT_BUILT_IN; return CURLE_NOT_BUILT_IN;
#endif #endif
} }
@ -652,7 +655,9 @@ CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
return CURLE_BAD_FUNCTION_ARGUMENT; return CURLE_BAD_FUNCTION_ARGUMENT;
} }
} }
ares_set_local_ip4((ares_channel)data->state.resolver, ntohl(a4)); ares_set_local_ip4((ares_channel)data->state.resolver, ntohl(a4));
return CURLE_OK; return CURLE_OK;
#else /* c-ares version too old! */ #else /* c-ares version too old! */
(void)data; (void)data;
@ -676,7 +681,9 @@ CURLcode Curl_set_dns_local_ip6(struct SessionHandle *data,
return CURLE_BAD_FUNCTION_ARGUMENT; return CURLE_BAD_FUNCTION_ARGUMENT;
} }
} }
ares_set_local_ip6((ares_channel)data->state.resolver, a6); ares_set_local_ip6((ares_channel)data->state.resolver, a6);
return CURLE_OK; return CURLE_OK;
#else /* c-ares version too old! */ #else /* c-ares version too old! */
(void)data; (void)data;

View File

@ -636,10 +636,10 @@ CURLcode Curl_set_dns_servers(struct SessionHandle *data,
} }
CURLcode Curl_set_dns_interface(struct SessionHandle *data, CURLcode Curl_set_dns_interface(struct SessionHandle *data,
const char *interface) const char *interf)
{ {
(void)data; (void)data;
(void)interface; (void)interf;
return CURLE_NOT_BUILT_IN; return CURLE_NOT_BUILT_IN;
} }

View File

@ -205,7 +205,7 @@ CURLcode Curl_set_dns_servers(struct SessionHandle *data, char *servers);
* outgoing interface to use for DNS requests * outgoing interface to use for DNS requests
*/ */
CURLcode Curl_set_dns_interface(struct SessionHandle *data, CURLcode Curl_set_dns_interface(struct SessionHandle *data,
const char *interface); const char *interf);
/* /*
* Function provided by the resolver backend to set * Function provided by the resolver backend to set

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -77,10 +77,10 @@ CURLcode Curl_set_dns_servers(struct SessionHandle *data,
* outgoing interface to use for DNS requests * outgoing interface to use for DNS requests
*/ */
CURLcode Curl_set_dns_interface(struct SessionHandle *data, CURLcode Curl_set_dns_interface(struct SessionHandle *data,
const char *interface) const char *interf)
{ {
(void)data; (void)data;
(void)interface; (void)interf;
return CURLE_NOT_BUILT_IN; return CURLE_NOT_BUILT_IN;
} }