[commit: ghc] master: rts/PosixSource.h: Define __USE_MINGW_ANSI_STDIO on Windows (6da6253)

git at git.haskell.org git at git.haskell.org
Fri Dec 9 04:06:17 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6da62535469149d69ec98674db1c51dbde0efab1/ghc

>---------------------------------------------------------------

commit 6da62535469149d69ec98674db1c51dbde0efab1
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Thu Dec 8 23:05:21 2016 -0500

    rts/PosixSource.h: Define __USE_MINGW_ANSI_STDIO on Windows
    
    This was removed in 8dc72f3c33b0e724ddb690c9d494969980c10afd which cleaned up
    PosixSource.h. Strangely, this only started breaking for me now.
    
    Test Plan: Validate on Windows
    
    Reviewers: simonmar, erikd, austin, Phyx
    
    Reviewed By: Phyx
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2812
    
    GHC Trac Issues: #12951


>---------------------------------------------------------------

6da62535469149d69ec98674db1c51dbde0efab1
 rts/PosixSource.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/rts/PosixSource.h b/rts/PosixSource.h
index 0ba74df..edf16b5 100644
--- a/rts/PosixSource.h
+++ b/rts/PosixSource.h
@@ -38,4 +38,17 @@
 #define _XOPEN_SOURCE   700
 #endif
 
+#if defined(mingw32_HOST_OS)
+/* Without this gcc will warn about %ull and the like since some msvcrt versions
+   do not support them. See
+   https://sourceforge.net/p/mingw-w64/mailman/message/28557333/
+
+   Note that this is implied by _POSIX_C_SOURCE in the msys2 toolchain that we
+   now use. However, we retain this explicit #define to preserve the ability to
+   bootstrap GHC with compilers still using msys (e.g. GHC 7.10.1 and 7.10.2).
+   This can be removed in for GHC 8.4. See #12951.
+  */
+#define __USE_MINGW_ANSI_STDIO 1
+#endif
+
 #endif /* POSIXSOURCE_H */



More information about the ghc-commits mailing list