shithub: opusfile

Download patch

ref: cc5f107c13b8d18e3a8ebfc7e07282b4f35d72b0
parent: 1e9d7d85af27e3fc547d0f6d4725823dcf153e13
author: Timothy B. Terriberry <tterribe@xiph.org>
date: Mon Jan 7 08:00:44 EST 2013

Require WindowsXP for mingw32.

This allows an i686-pc-mingw32 build to use getaddrinfo/
 freeaddrinfo correctly.
It's not needed for an i686-w64-mingw32 build, but it doesn't hurt
 to leave it in here.
i686-pc-mingw32 still won't work correctly, because it does not
 support fseeko/ftello, nor (unless using MSVCRT 8.0 or later)
 _fseeki64/_ftelli64.
We could define __MSVCRT_VERSION__ to 0x800 to get the latter, but
 this would require different MSVCRT versions than libogg and
 libopus are built with by default, which makes a bit of a mess.

--- a/configure.ac
+++ b/configure.ac
@@ -37,6 +37,12 @@
   *-mingw*)
     # -std=c89 causes some warnings under mingw.
     CC_CHECK_CFLAGS_APPEND([-U__STRICT_ANSI__])
+    # We need WINNT>=0x501 (WindowsXP) for getaddrinfo/freeaddrinfo.
+    # It's okay to define this even when HTTP support is disabled, as it only
+    #  affects header declarations, not linking (unless we actually use some
+    #  XP-only functions).
+    AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x501,
+     [We need at least WindowsXP for getaddrinfo/freaddrinfo])
     host_mingw=true
     ;;
 esac