I've seen a very good news that a fix to libstdc++ is on its way and that's great. However, we need to support already released versions as well. That's why I propose this patch. Ideally, we'd use __GLIBCXX__ macro, but it's not available without including any standard header and sal.h is not a good place to do that. In the future, when libstdc++ is fixed, we may change guards to be version-dependent.

Signed-off-by: Jacek Caban <[email protected]>
---
 mingw-w64-headers/include/sal.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)


diff --git a/mingw-w64-headers/include/sal.h b/mingw-w64-headers/include/sal.h
index 8542a175..9f9a8917 100644
--- a/mingw-w64-headers/include/sal.h
+++ b/mingw-w64-headers/include/sal.h
@@ -207,11 +207,17 @@
 #define _Analysis_assume_(expr)
 #define _Analysis_assume_nullterminated_(expr)
 
+/* FIXME: __in macro conflicts with argument names in libstdc++. For this reason,
+ * we disable it for C++. This should be fixed in libstdc++ so we can uncomment
+ * it in fixed version here. */
+#if !defined(__cplusplus) && !defined(__GNUC__)
 #define __in
+#define __out
+#endif
+
 #define __in_bcount(size)
 #define __in_ecount(size)
 
-#define __out
 #define __out_bcount(size)
 #define __out_bcount_part(size, length)
 #define __out_ecount(size)

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to