Not only does gnulib key off of the definition of _IOERR to know whether
to use its UCRT definitions, but the constants are different between
MSVCRT and the (internal) constants in UCRT source.

It turns out that the constants _IOFBF _IOLBF and _IONBF are still
present in the UCRT headers (they are used by setvbuf), but I have
confirmed none of the others are.

Reference: https://github.com/msys2/MINGW-packages/issues/8310
Signed-off-by: Jeremy Drake <jeremyd2...@users.sourceforge.net>
---
 mingw-w64-headers/crt/stdio.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h
index c7617798..fe15add0 100644
--- a/mingw-w64-headers/crt/stdio.h
+++ b/mingw-w64-headers/crt/stdio.h
@@ -120,13 +120,13 @@ extern FILE (* __MINGW_IMP_SYMBOL(_iob))[];       /* A 
pointer to an array of FILE */
 #define stderr (__acrt_iob_func(2))
 #endif

-#define _IOREAD 0x0001
-#define _IOWRT 0x0002
-
 #define _IOFBF 0x0000
 #define _IOLBF 0x0040
 #define _IONBF 0x0004

+#ifndef _UCRT
+#define _IOREAD 0x0001
+#define _IOWRT 0x0002
 #define _IOMYBUF 0x0008
 #define _IOEOF 0x0010
 #define _IOERR 0x0020
@@ -135,6 +135,7 @@ extern FILE (* __MINGW_IMP_SYMBOL(_iob))[]; /* A pointer to 
an array of FILE */
 #ifdef _POSIX_
 #define _IOAPPEND 0x0200
 #endif
+#endif

 #define _TWO_DIGIT_EXPONENT 0x1

-- 
2.31.1.windows.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