summaryrefslogtreecommitdiff
path: root/rts/PosixSource.h
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2016-12-08 23:05:21 -0500
committerBen Gamari <ben@smart-cactus.org>2016-12-08 23:05:43 -0500
commit6da62535469149d69ec98674db1c51dbde0efab1 (patch)
tree9c737d8aafbff9dfdf96444cab71eb223979f483 /rts/PosixSource.h
parent2bb099e5ccd7255f9742cb8bc5d512cd92d035b6 (diff)
downloadhaskell-6da62535469149d69ec98674db1c51dbde0efab1.tar.gz
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
Diffstat (limited to 'rts/PosixSource.h')
-rw-r--r--rts/PosixSource.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/rts/PosixSource.h b/rts/PosixSource.h
index 0ba74dfa69..edf16b5b1a 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 */