From aa12e2be5a1bd92e9b20988592ef9b45e30815a7 Mon Sep 17 00:00:00 2001 From: Anthony Roberts Date: Thu, 27 Mar 2025 11:34:02 +0000 Subject: [PATCH 1/2] Fix build issue when using clang (#2137) Signed-off-by: Anthony Roberts --- src/OpenColorIO/SSE2.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/OpenColorIO/SSE2.h b/src/OpenColorIO/SSE2.h index e51dad9b50..4b163c5ff3 100644 --- a/src/OpenColorIO/SSE2.h +++ b/src/OpenColorIO/SSE2.h @@ -27,10 +27,14 @@ #undef _mm_min_ps #endif - // Current versions of MSVC do not define float16_t, so we do it ourselves using + // Current versions of MSVC/clang do not define float16_t, so we do it ourselves using // int16_t as an intermediate type #if defined(_M_ARM64) && !defined(float16_t) - #define float16_t int16_t + #if defined(__clang__) + #define float16_t __fp16 + #else + #define float16_t int16_t + #endif #endif // Current versions of MSVC do not define vst1q_f16, so we do it ourselves using From 85d1687810ed97d02ecff6631687339911aca65b Mon Sep 17 00:00:00 2001 From: Anthony Roberts Date: Fri, 28 Mar 2025 11:08:59 +0000 Subject: [PATCH 2/2] Change define check, and update comment Signed-off-by: Anthony Roberts --- src/OpenColorIO/SSE2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpenColorIO/SSE2.h b/src/OpenColorIO/SSE2.h index 4b163c5ff3..0128623405 100644 --- a/src/OpenColorIO/SSE2.h +++ b/src/OpenColorIO/SSE2.h @@ -28,8 +28,8 @@ #endif // Current versions of MSVC/clang do not define float16_t, so we do it ourselves using - // int16_t as an intermediate type - #if defined(_M_ARM64) && !defined(float16_t) + // int16_t as an intermediate type (on MSVC), or the built-in __fp16 type (on clang) + #if !defined(float16_t) #if defined(__clang__) #define float16_t __fp16 #else