[commit: ghc] wip/angerman/win32-cross: Fix windows wchar with `_s` for mingw (9facc31)

git at git.haskell.org git at git.haskell.org
Mon Feb 26 06:13:05 UTC 2018


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

On branch  : wip/angerman/win32-cross
Link       : http://ghc.haskell.org/trac/ghc/changeset/9facc3152cbacd972a6ff6f43335efc0a3ae7074/ghc

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

commit 9facc3152cbacd972a6ff6f43335efc0a3ae7074
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date:   Wed Feb 21 16:42:12 2018 +0800

    Fix windows wchar with `_s` for mingw


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

9facc3152cbacd972a6ff6f43335efc0a3ae7074
 libraries/base/cbits/Win32Utils.c | 2 ++
 rts/PathUtils.c                   | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/libraries/base/cbits/Win32Utils.c b/libraries/base/cbits/Win32Utils.c
index ce7ce97..b33db04 100644
--- a/libraries/base/cbits/Win32Utils.c
+++ b/libraries/base/cbits/Win32Utils.c
@@ -9,6 +9,8 @@
 #include "HsBase.h"
 #include <stdbool.h>
 #include <stdint.h>
+/* Using Secure APIs */
+#define MINGW_HAS_SECURE_API 1
 #include <wchar.h>
 #include <windows.h>
 
diff --git a/rts/PathUtils.c b/rts/PathUtils.c
index 1b0b729..def3f7e 100644
--- a/rts/PathUtils.c
+++ b/rts/PathUtils.c
@@ -7,6 +7,11 @@
 
 #include <libgen.h>
 #include <ctype.h>
+#if defined(mingw32_HOST_OS)
+/* Using Secure APIs */
+#define MINGW_HAS_SECURE_API 1
+#include <wchar.h>
+#endif
 
 pathchar* pathdup(pathchar *path)
 {



More information about the ghc-commits mailing list