Commit 2f3e8f9b authored by Ghislain MARY's avatar Ghislain MARY

Allow usage of USE_FIXED_NAMESERVERS on platforms other than Windows.

parent 87d7b23c
......@@ -165,17 +165,22 @@ static struct dns_resolv_conf *resconf(belle_sip_simple_resolver_context_t *ctx)
path=belle_sip_stack_get_dns_resolv_conf_file(ctx->base.stack);
if (!path){
#ifdef _WIN32
#if defined(USE_FIXED_NAMESERVERS)
error = dns_resconf_load_fixed_nameservers(ctx->resconf);
if (error) {
belle_sip_error("%s dns_resconf_load_fixed_name_servers error", __FUNCTION__);
}
#elif defined(_WIN32)
error = dns_resconf_loadwin(ctx->resconf);
if (error) {
belle_sip_error("%s dns_resconf_loadwin error", __FUNCTION__);
}
#elif ANDROID
#elif defined(ANDROID)
error = dns_resconf_loadandroid(ctx->resconf);
if (error) {
belle_sip_error("%s dns_resconf_loadandroid error", __FUNCTION__);
}
#elif HAVE_RESINIT
#elif defined(HAVE_RESINIT)
/*#elif HAVE_RESINIT && TARGET_OS_IPHONE*/
error = dns_resconf_loadfromresolv(ctx->resconf);
if (error) {
......
......@@ -4193,9 +4193,8 @@ int dns_resconf_loadpath(struct dns_resolv_conf *resconf, const char *path) {
} /* dns_resconf_loadpath() */
#ifdef _WIN32
int dns_resconf_loadwin(struct dns_resolv_conf *resconf) {
#if USE_FIXED_NAMESERVERS
#ifdef USE_FIXED_NAMESERVERS
int dns_resconf_load_fixed_nameservers(struct dns_resolv_conf *resconf) {
const char * const nameservers[] = {
"8.8.8.8",
"8.8.4.4"
......@@ -4208,7 +4207,11 @@ int dns_resconf_loadwin(struct dns_resolv_conf *resconf) {
}
return error;
#else
}
#endif /* USE_FIXED_NAMESERVERS */
#ifdef _WIN32
int dns_resconf_loadwin(struct dns_resolv_conf *resconf) {
FIXED_INFO *pFixedInfo;
ULONG ulOutBufLen;
DWORD dwRetVal;
......@@ -4241,7 +4244,6 @@ int dns_resconf_loadwin(struct dns_resolv_conf *resconf) {
}
return error;
#endif
} /* dns_resconf_loadwin() */
#endif
......
......@@ -910,6 +910,9 @@ int dns_resconf_loadfile(struct dns_resolv_conf *, FILE *);
int dns_resconf_loadpath(struct dns_resolv_conf *, const char *);
#ifdef USE_FIXED_NAMESERVERS
int dns_resconf_load_fixed_nameservers(struct dns_resolv_conf *resconf);
#endif /* USE_FIXED_NAMESERVERS */
#ifdef _WIN32
int dns_resconf_loadwin(struct dns_resolv_conf *);
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment