headers: Avoid builtin clash with _xgetbv in Clang 9 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ö <martin@martin.st>
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 @@ #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);