diff --git a/HISTORY b/HISTORY index 5c2f3f5d..305925ba 100644 --- a/HISTORY +++ b/HISTORY @@ -27,6 +27,8 @@ SnapRAID HISTORY number for the amount of space that you can still waste. * Renames the -s and -t options to -S and -B as they are intended to be manual only operations. + * Windows binary built with gcc 4.8.1 using the MXE cross compiler 2.23, + with targets i686-w64-mingw32 and x86_64-w64-mingw32. 7.1 2015/01 =========== diff --git a/cmdline/portable.h b/cmdline/portable.h index 6d657d8e..8a6adf59 100644 --- a/cmdline/portable.h +++ b/cmdline/portable.h @@ -25,10 +25,27 @@ /***************************************************************************/ /* Config */ -#ifdef __MINGW32__ /* Specific for MINGW */ -#define __USE_MINGW_ANSI_STDIO 1 /* Enable the GNU printf functions instead of using the MSVCRT ones */ -#define __MSVCRT_VERSION__ 0x0601 /* Define the MSVCRT version targetting Windows XP */ -#define _WIN32_WINNT 0x501 /* Include Windows XP CreateHardLinkW */ +#ifdef __MINGW32__ +/** + * Enable the GNU printf functions instead of using the MSVCRT ones. + * + * Note that this is the default if _POSIX is also defined. + * To disable it you have to set it to 0. + */ +#define __USE_MINGW_ANSI_STDIO 1 + +/* + * Define the MSVCRT version targetting Windows XP. + */ +#define __MSVCRT_VERSION__ 0x0601 + +/** + * Include Windows XP headers. + * + * Like for CreateHardLinkW(). + */ +#define _WIN32_WINNT 0x501 + #include #endif @@ -36,7 +53,7 @@ * Specify the format attribute for printf. */ #ifdef __MINGW32__ -#ifdef __USE_MINGW_ANSI_STDIO +#if defined(__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO == 1 #define attribute_printf gnu_printf /* GNU format */ #else #define attribute_printf ms_printf /* MSVCRT format */ diff --git a/configure.windows-x86 b/configure.windows-x86 index f682a966..ba87a88c 100755 --- a/configure.windows-x86 +++ b/configure.windows-x86 @@ -1,2 +1,3 @@ -./configure --host=i686-pc-mingw32 --build=`./config.guess` $@ +./configure --host=i686-w64-mingw32 --build=`./config.guess` $@ +