Skip to content

Commit db68839

Browse files
Fix build issue when using clang (#2137) (#2140)
* Fix build issue when using clang (#2137) Signed-off-by: Anthony Roberts <anthony.roberts@linaro.org> * Change define check, and update comment Signed-off-by: Anthony Roberts <anthony.roberts@linaro.org> --------- Signed-off-by: Anthony Roberts <anthony.roberts@linaro.org> Co-authored-by: Doug Walker <doug.walker@autodesk.com>
1 parent b6d33f7 commit db68839

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/OpenColorIO/SSE2.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@
2727
#undef _mm_min_ps
2828
#endif
2929

30-
// Current versions of MSVC do not define float16_t, so we do it ourselves using
31-
// int16_t as an intermediate type
32-
#if defined(_M_ARM64) && !defined(float16_t)
33-
#define float16_t int16_t
30+
// Current versions of MSVC/clang do not define float16_t, so we do it ourselves using
31+
// int16_t as an intermediate type (on MSVC), or the built-in __fp16 type (on clang)
32+
#if !defined(float16_t)
33+
#if defined(__clang__)
34+
#define float16_t __fp16
35+
#else
36+
#define float16_t int16_t
37+
#endif
3438
#endif
3539

3640
// Current versions of MSVC do not define vst1q_f16, so we do it ourselves using

0 commit comments

Comments
 (0)