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

Fix compilation against WinXP (conflicting symbols)

parent 975c118a
...@@ -119,11 +119,11 @@ const char *vlc_gai_strerror (int errnum) ...@@ -119,11 +119,11 @@ const char *vlc_gai_strerror (int errnum)
*/ */
#ifdef WIN32 #ifdef WIN32
static int WSAAPI static int WSAAPI
getnameinfo (const struct sockaddr *sa, socklen_t salen, stub_getnameinfo (const struct sockaddr *sa, socklen_t salen,
char *host, DWORD hostlen, char *serv, DWORD servlen, int flags) char *host, DWORD hostlen, char *serv, DWORD servlen, int flags)
#else #else
static int static int
getnameinfo (const struct sockaddr *sa, socklen_t salen, stub_getnameinfo (const struct sockaddr *sa, socklen_t salen,
char *host, int hostlen, char *serv, int servlen, int flags) char *host, int hostlen, char *serv, int servlen, int flags)
#endif #endif
{ {
...@@ -165,7 +165,8 @@ getnameinfo (const struct sockaddr *sa, socklen_t salen, ...@@ -165,7 +165,8 @@ getnameinfo (const struct sockaddr *sa, socklen_t salen,
} }
return 0; return 0;
} }
#undef getnameinfo
#define getnameifo stub_getnameinfo
#endif /* if !HAVE_GETNAMEINFO */ #endif /* if !HAVE_GETNAMEINFO */
#ifndef HAVE_GETADDRINFO #ifndef HAVE_GETADDRINFO
...@@ -201,9 +202,9 @@ gai_error_from_herrno (void) ...@@ -201,9 +202,9 @@ gai_error_from_herrno (void)
* This functions must be used to free the memory allocated by getaddrinfo(). * This functions must be used to free the memory allocated by getaddrinfo().
*/ */
#ifdef WIN32 #ifdef WIN32
static void WSAAPI freeaddrinfo (struct addrinfo *res) static void WSAAPI stub_freeaddrinfo (struct addrinfo *res)
#else #else
static void freeaddrinfo (struct addrinfo *res) static void stub_freeaddrinfo (struct addrinfo *res)
#endif #endif
{ {
if (res == NULL) if (res == NULL)
...@@ -286,11 +287,11 @@ makeipv4info (int type, int proto, u_long ip, u_short port, const char *name) ...@@ -286,11 +287,11 @@ makeipv4info (int type, int proto, u_long ip, u_short port, const char *name)
*/ */
#ifdef WIN32 #ifdef WIN32
static int WSAAPI static int WSAAPI
getaddrinfo (const char *node, const char *service, stub_getaddrinfo (const char *node, const char *service,
const struct addrinfo *hints, struct addrinfo **res) const struct addrinfo *hints, struct addrinfo **res)
#else #else
static int static int
getaddrinfo (const char *node, const char *service, stub_getaddrinfo (const char *node, const char *service,
const struct addrinfo *hints, struct addrinfo **res) const struct addrinfo *hints, struct addrinfo **res)
#endif #endif
{ {
...@@ -437,6 +438,10 @@ getaddrinfo (const char *node, const char *service, ...@@ -437,6 +438,10 @@ getaddrinfo (const char *node, const char *service,
return 0; return 0;
} }
#undef getaddrinfo
#define getaddrifo stub_getaddrinfo
#undef freeaddrinfo
#define freeaddrifo stub_freeaddrinfo
#endif /* if !HAVE_GETADDRINFO */ #endif /* if !HAVE_GETADDRINFO */
#if defined( WIN32 ) && !defined( UNDER_CE ) #if defined( WIN32 ) && !defined( UNDER_CE )
...@@ -490,8 +495,7 @@ static WSAAPI int _ws2_getnameinfo_bind( const struct sockaddr FAR * sa, socklen ...@@ -490,8 +495,7 @@ static WSAAPI int _ws2_getnameinfo_bind( const struct sockaddr FAR * sa, socklen
if (entry == NULL) if (entry == NULL)
{ {
/* not found, use replacement API instead */ /* not found, use replacement API instead */
entry = getnameinfo; entry = stub_getnameinfo;
} }
/* call API before replacing function pointer to avoid crash */ /* call API before replacing function pointer to avoid crash */
result = entry (sa, salen, host, hostlen, serv, servlen, flags); result = entry (sa, salen, host, hostlen, serv, servlen, flags);
...@@ -514,8 +518,8 @@ static WSAAPI int _ws2_getaddrinfo_bind(const char FAR *node, const char FAR *se ...@@ -514,8 +518,8 @@ static WSAAPI int _ws2_getaddrinfo_bind(const char FAR *node, const char FAR *se
if ((entry == NULL) || (freentry == NULL)) if ((entry == NULL) || (freentry == NULL))
{ {
/* not found, use replacement API instead */ /* not found, use replacement API instead */
entry = getaddrinfo; entry = stub_getaddrinfo;
freentry = freeaddrinfo; freentry = stub_freeaddrinfo;
} }
/* call API before replacing function pointer to avoid crash */ /* call API before replacing function pointer to avoid crash */
result = entry (node, service, hints, res); result = entry (node, service, hints, res);
...@@ -531,7 +535,6 @@ static WSAAPI int _ws2_getaddrinfo_bind(const char FAR *node, const char FAR *se ...@@ -531,7 +535,6 @@ static WSAAPI int _ws2_getaddrinfo_bind(const char FAR *node, const char FAR *se
#endif #endif
int vlc_getnameinfo( const struct sockaddr *sa, int salen, int vlc_getnameinfo( const struct sockaddr *sa, int salen,
char *host, int hostlen, int *portnum, int flags ) char *host, int hostlen, int *portnum, int flags )
{ {
......
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