Skip to content

Commit d87fa22

Browse files
committed
fix(build): Recent change broke when using non-Apple clang on Apple (AcademySoftwareFoundation#4596)
This fixes a problem introduced with AcademySoftwareFoundation#4582 Signed-off-by: Larry Gritz <[email protected]>
1 parent 534f990 commit d87fa22

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/include/OpenImageIO/typedesc.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,11 @@ template<> struct BaseTypeFromC<uint32_t> { static const TypeDesc::BASETYPE valu
401401
template<> struct BaseTypeFromC<int32_t> { static const TypeDesc::BASETYPE value = TypeDesc::INT; };
402402
template<> struct BaseTypeFromC<uint64_t> { static const TypeDesc::BASETYPE value = TypeDesc::UINT64; };
403403
template<> struct BaseTypeFromC<int64_t> { static const TypeDesc::BASETYPE value = TypeDesc::INT64; };
404-
#if defined(__GNUC__) && !defined(__apple_build_version__) && __WORDSIZE == 64
405-
// gcc on some platforms consider int64_t and long long to be different
406-
// types, even though they are actually the same size.
404+
#if defined(__GNUC__) && __WORDSIZE == 64 && !(defined(__APPLE__) && defined(__MACH__))
405+
// Some platforms consider int64_t and long long to be different types, even
406+
// though they are actually the same size.
407+
static_assert(!std::is_same_v<unsigned long long, uint64_t>);
408+
static_assert(!std::is_same_v<long long, int64_t>);
407409
template<> struct BaseTypeFromC<unsigned long long> { static const TypeDesc::BASETYPE value = TypeDesc::UINT64; };
408410
template<> struct BaseTypeFromC<long long> { static const TypeDesc::BASETYPE value = TypeDesc::INT64; };
409411
#endif

0 commit comments

Comments
 (0)