From: Jacek Caban <ja...@codeweavers.com>

This can be used both by defining it externally, for setting
__MSVCRT_VERSION__ to the right value, or by checking if _UCRT is
defined.

Signed-off-by: Martin Storsjo <mar...@martin.st>
---
 mingw-w64-headers/crt/_mingw.h.in | 6 +++++-
 mingw-w64-headers/crt/corecrt.h   | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/mingw-w64-headers/crt/_mingw.h.in 
b/mingw-w64-headers/crt/_mingw.h.in
index 7e80a243a..d026da3ae 100644
--- a/mingw-w64-headers/crt/_mingw.h.in
+++ b/mingw-w64-headers/crt/_mingw.h.in
@@ -222,7 +222,11 @@ limitations in handling dllimport attribute.  */
 
 #ifndef __MSVCRT_VERSION__
 /*  High byte is the major version, low byte is the minor. */
-# define __MSVCRT_VERSION__ @DEFAULT_MSVCRT_VERSION@
+# ifndef _UCRT
+#  define __MSVCRT_VERSION__ @DEFAULT_MSVCRT_VERSION@
+# else
+#  define __MSVCRT_VERSION__ 0x1400
+# endif
 #endif
 
 
diff --git a/mingw-w64-headers/crt/corecrt.h b/mingw-w64-headers/crt/corecrt.h
index 44d32d620..e7078d66b 100644
--- a/mingw-w64-headers/crt/corecrt.h
+++ b/mingw-w64-headers/crt/corecrt.h
@@ -15,6 +15,10 @@
 #pragma pack(push,_CRT_PACKING)
 #endif
 
+#if !defined(_UCRT) && (__MSVCRT_VERSION__ >= 0x1400)
+#define _UCRT
+#endif
+
 #ifdef __ERRCODE_DEFINED_MS
 /* #define __ERRCODE_DEFINED_MS */
 typedef int errcode;
-- 
2.17.1



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to