Clang 9 adds _xgetbv for non-msvc targets, by adding a builtin
named __builtin_ia32_xgetbv and a define in a header redirecting
_xgetbv to __builtin_ia32_xgetbv. The define redirection breaks
the intrin-impl.h code already on the prototype.

Signed-off-by: Martin Storsjö <mar...@martin.st>
---
 mingw-w64-headers/include/psdk_inc/intrin-impl.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mingw-w64-headers/include/psdk_inc/intrin-impl.h 
b/mingw-w64-headers/include/psdk_inc/intrin-impl.h
index 4c6d8fd..072a98f 100644
--- a/mingw-w64-headers/include/psdk_inc/intrin-impl.h
+++ b/mingw-w64-headers/include/psdk_inc/intrin-impl.h
@@ -1938,7 +1938,9 @@ __buildmov(__movsd, unsigned __LONG32, "d")
 #define __INTRINSIC_DEFINED___movsd
 #endif /* __INTRINSIC_PROLOG */
 
-#if !defined(__GNUC__) || __GNUC__ < 8 /* GCC 8 has already defined _xgetbv */
+/* GCC 8 has already defined _xgetbv, Clang 9 has _xgetbv defined as a macro
+ * redirecting to the __builtin_ia32_xgetbv builtin. */
+#if (!defined(__GNUC__) || __GNUC__ < 8) && !defined(_xgetbv)
 /* NOTE: This should be in immintrin.h */
 #if __INTRINSIC_PROLOG(_xgetbv)
 unsigned __int64 _xgetbv(unsigned int);
-- 
2.7.4



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

Reply via email to