Commit b6bf4381 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use replacement API for obsolete systems. Not tested.

parent 6c477241
...@@ -102,7 +102,6 @@ const char *vlc_gai_strerror (int errnum) ...@@ -102,7 +102,6 @@ const char *vlc_gai_strerror (int errnum)
} }
#endif #endif
#ifndef WIN32
#ifndef HAVE_GETNAMEINFO #ifndef HAVE_GETNAMEINFO
/* /*
* getnameinfo() non-thread-safe IPv4-only implementation, * getnameinfo() non-thread-safe IPv4-only implementation,
...@@ -448,7 +447,6 @@ getaddrinfo (const char *node, const char *service, ...@@ -448,7 +447,6 @@ getaddrinfo (const char *node, const char *service,
return 0; return 0;
} }
#endif /* if !HAVE_GETADDRINFO */ #endif /* if !HAVE_GETADDRINFO */
#endif
#if defined( WIN32 ) && !defined( UNDER_CE ) #if defined( WIN32 ) && !defined( UNDER_CE )
/* /*
...@@ -503,13 +501,17 @@ static WSAAPI int _ws2_getnameinfo_bind( const struct sockaddr FAR * sa, socklen ...@@ -503,13 +501,17 @@ static WSAAPI int _ws2_getnameinfo_bind( const struct sockaddr FAR * sa, socklen
ws2_getnameinfo = entry; ws2_getnameinfo = entry;
return result; return result;
} }
/* return a possible error if API is not found */ return getnameinfo (sa, salen, host, hostlen, serv, servlen, flags);
WSASetLastError (WSAEAFNOSUPPORT);
return EAI_FAMILY;
} }
#undef getnameinfo #undef getnameinfo
#define getnameinfo ws2_getnameinfo #define getnameinfo ws2_getnameinfo
/* So much for using different calling conventions */
static WSAAPI void call_freeaddrinfo (struct addrinfo *infos)
{
freeaddrinfo (infos);
}
static WSAAPI int _ws2_getaddrinfo_bind(const char FAR *node, const char FAR *service, static WSAAPI int _ws2_getaddrinfo_bind(const char FAR *node, const char FAR *service,
const struct addrinfo FAR *hints, struct addrinfo FAR * FAR *res) const struct addrinfo FAR *hints, struct addrinfo FAR * FAR *res)
{ {
...@@ -527,9 +529,8 @@ static WSAAPI int _ws2_getaddrinfo_bind(const char FAR *node, const char FAR *se ...@@ -527,9 +529,8 @@ static WSAAPI int _ws2_getaddrinfo_bind(const char FAR *node, const char FAR *se
ws2_getaddrinfo = entry; ws2_getaddrinfo = entry;
return result; return result;
} }
/* return a possible error if API is not found */ ws2_freeaddrinfo = call_freeaddrinfo;
WSASetLastError (WSAHOST_NOT_FOUND); return getaddrinfo (node, service, hints, res);
return EAI_NONAME;
} }
#undef getaddrinfo #undef getaddrinfo
#undef freeaddrinfo #undef freeaddrinfo
......
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