From d87fa22a3d11abf269ca74cfc762ed075223ebb4 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Wed, 15 Jan 2025 15:28:27 -0800 Subject: [PATCH] fix(build): Recent change broke when using non-Apple clang on Apple (#4596) This fixes a problem introduced with #4582 Signed-off-by: Larry Gritz --- src/include/OpenImageIO/typedesc.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/include/OpenImageIO/typedesc.h b/src/include/OpenImageIO/typedesc.h index 9263a209eb..b6ac37cef0 100644 --- a/src/include/OpenImageIO/typedesc.h +++ b/src/include/OpenImageIO/typedesc.h @@ -401,9 +401,11 @@ template<> struct BaseTypeFromC { static const TypeDesc::BASETYPE valu template<> struct BaseTypeFromC { static const TypeDesc::BASETYPE value = TypeDesc::INT; }; template<> struct BaseTypeFromC { static const TypeDesc::BASETYPE value = TypeDesc::UINT64; }; template<> struct BaseTypeFromC { static const TypeDesc::BASETYPE value = TypeDesc::INT64; }; -#if defined(__GNUC__) && !defined(__apple_build_version__) && __WORDSIZE == 64 -// gcc on some platforms consider int64_t and long long to be different -// types, even though they are actually the same size. +#if defined(__GNUC__) && __WORDSIZE == 64 && !(defined(__APPLE__) && defined(__MACH__)) +// Some platforms consider int64_t and long long to be different types, even +// though they are actually the same size. +static_assert(!std::is_same_v); +static_assert(!std::is_same_v); template<> struct BaseTypeFromC { static const TypeDesc::BASETYPE value = TypeDesc::UINT64; }; template<> struct BaseTypeFromC { static const TypeDesc::BASETYPE value = TypeDesc::INT64; }; #endif