clang-cl fails on pixman-mmx.c
While using clang-cl v. 10 to compile pixman-mmx.c
, this error occurred:
pixman-mmx.c(247,8): error: member reference base type '__m64' (vector of 1 'long long' value) is not a structure or
union
res.M64_MEMBER = x;
~~~^~~~~~~~~~~
pixman-mmx.c(262,21): error: member reference base type '__m64' (vector of 1 'long long' value) is not a structure or
union
uint64_t res = x.M64_MEMBER;
~^~~~~~~~~~~
clang-cl
(with _MSC_VER
as a built-in) tries to be very close to MSVC.
But it's not wrt. to this __m64
type (more close to gcc).
So with this patch it compiles:
--- a/pixman-mmx.c 2020-05-12 16:57:16
+++ b/pixman-mmx.c 2020-05-16 04:01:38
@@ -137,13 +137,13 @@
* then define USE_M64_CASTS.
* If __m64 is a double datatype, then define USE_M64_DOUBLE.
*/
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && !defined(__clang__)
# define M64_MEMBER m64_u64
#elif defined(__ICC)
# define USE_CVT_INTRINSICS
#elif defined(USE_LOONGSON_MMI)
# define USE_M64_DOUBLE
-#elif defined(__GNUC__)
+#elif defined(__GNUC__) || defined(__clang__)
# define USE_M64_CASTS
#elif defined(__SUNPRO_C)
# if (__SUNPRO_C >= 0x5120) && !defined(__NOVECTORSIZE__)