Commit 923b33a3 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

win32: define __MSVCRT_VERSION__ when compiling with MingW, for __stat64

Need to define this when using MingW, so that the includes provide
__stat64 and friends. We need at least Windows XP SP2 for this.
Fixes #568632.
parent 581ccbb5
......@@ -231,6 +231,25 @@ case $host_os in
mingw* | msvc* | mks*)
dnl HAVE_WIN32 currently means "disable POSIXisms".
AC_DEFINE_UNQUOTED(HAVE_WIN32, 1, [Defined if compiling for Windows])
dnl define __MSVCRT_VERSION__ version if not set already by the
dnl compiler (ie. mostly for mingw). This is needed for things like
dnl __stat64 to be available. If set by the compiler, ensure it's
dnl new enough - we need at least WinXP SP2.
AC_TRY_COMPILE([ ], [ return __MSVCRT_VERSION__; ], [
#if __MSVCRT_VERSION__ < 0x0601
#error "MSVCRT too old"
], [
AC_MSG_NOTICE([MSVCRT version looks ok])
], [
AC_MSG_ERROR([MSVCRT version too old, need at least WinXP SP2])
], [
AC_MSG_NOTICE([Setting MSVCRT version to 0x0601])
AC_DEFINE_UNQUOTED(__MSVCRT_VERSION__, 0x0601, [We need at least WinXP SP2 for __stat64])
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