Patchwork [mingw] : Make POSIX-printf for mingw-based builds default

login
register
mail settings
Submitter Kai Tietz
Date March 22, 2013, 8:07 a.m.
Message ID <CAEwic4bxkp4ygDz6bgXYTZHgKrE6D9veQV3=DphdOD6k=oanMw@mail.gmail.com>
Download mbox | patch
Permalink /patch/229902/
State New
Headers show

Comments

Kai Tietz - March 22, 2013, 8:07 a.m.
Hi,

this patch enables the POSIX-printf variant for mingw-hosts by default.

ChangeLog

2013-03-22  Kai Tietz  <ktietz@redhat.com>

        * config/i386/xm-mingw32.h (__USE_MINGW_ANSI_STDIO): Enable POSIX-printf
        for mingw-hosted  builds.

Tested for i686-w64-mingw32, and x86_64-w64-mingw32.  I will apply
tomorrow, if there aren't any objections by other Windows-maintainers.

Regards,
Kai

Patch

Index: gcc/config/i386/xm-mingw32.h
===================================================================
--- gcc/config/i386/xm-mingw32.h	(Revision 196898)
+++ gcc/config/i386/xm-mingw32.h	(Arbeitskopie)
@@ -29,6 +29,12 @@  along with GCC; see the file COPYING3.  If not see
 /*  The st_ino field of struct stat is always 0.  */
 #define HOST_LACKS_INODE_NUMBERS

+#ifdef __MINGW32__
+#undef __USE_MINGW_ANSI_STDIO
+#define __USE_MINGW_ANSI_STDIO 1
+#else
 /* MSVCRT does not support the "ll" format specifier for printing
    "long long" values.  Instead, we use "I64".  */
 #define HOST_LONG_LONG_FORMAT "I64"
+#endif
+