[FFmpeg-devel] [PATCH] Enable proper IPv6 functions on windows

Martin Storsjö martin
Fri Jan 15 23:49:44 CET 2010

On Fri, 15 Jan 2010, Reimar D?ffinger wrote:

> May I say: WTF are you doing?
> The defines do not matter one bit, just set -D_WIN32_WINNT=0x0501 and be done
> with it, that is not an issue _whatsoever_.

Well, IMO setting the define is a good way to be able to use the normal 
configure checks to see what's available at the platform version we're 
targeting. So instead of littering the actual code with platform specific 
hacks, we simply check if function foo is available on the target 

> Disabling gettaddrinfo sure is possible, but
> a) no need to hack the defines for that
> b) what is the big deal with just not enabling getaddrinfo with HAVE_WINSOCK2_H
> and start ff_get_procaddres with
>   int WSAAPI (*wingetaddrinfo)(const char *, const char *, const struct addrinfo *, struct addrinfo **);
>   HMODULE ws2mod = GetModuleHandle("ws2_32.dll");
>   wingetaddrinfo = GetProcAddress(ws2mod, "getaddrinfo");
>   if (wingetaddrinfo)
>     return wingetaddrinfo(...);
> #endif

I proposed a version of that, too, in 
but the simpler way to simply link directly to the getaddrinfo function 
was preferred by Ronald, in this follow-up:

But yes, that would be the most compatible solution, ending up with a 
binary compatible with older platforms and still being able to utilize the 
newer functions when available.

// Martin

More information about the ffmpeg-devel mailing list