From 9e4b04f8b9bce79adeb6f7784619a93d5682d509 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Mon, 25 Jun 2012 12:50:13 +0300 Subject: network: Always use our version of gai_strerror on windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Even if linking directly to getaddrinfo, use our version of gai_strerror instead of the system's version. Microsoft explicitly documents that their version of gai_strerror is thread-unsafe. Signed-off-by: Martin Storsjö --- libavformat/os_support.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libavformat/os_support.c') diff --git a/libavformat/os_support.c b/libavformat/os_support.c index 76204e0546..9992a631c5 100644 --- a/libavformat/os_support.c +++ b/libavformat/os_support.c @@ -239,7 +239,9 @@ int ff_getnameinfo(const struct sockaddr *sa, int salen, return 0; } +#endif /* !HAVE_GETADDRINFO */ +#if !HAVE_GETADDRINFO || HAVE_WINSOCK2_H const char *ff_gai_strerror(int ecode) { switch(ecode) { @@ -258,7 +260,7 @@ const char *ff_gai_strerror(int ecode) return "Unknown error"; } -#endif +#endif /* !HAVE_GETADDRINFO || HAVE_WINSOCK2_H */ int ff_socket_nonblock(int socket, int enable) { -- cgit v1.2.3