Skip to content

Commit 54f208f

Browse files
committed
build: fix BaseTypeFromC on 64 bit musl libc
Use standard defines to determine if the system is 64 bits. Despite __WORDSIZE not being standard, musl libc also has it defined in another header (either bits/reg.h or bits/user.h), but it is probably a good idea to avoid using it anyway for standard compliance. Signed-off-by: omcaif <[email protected]>
1 parent abce1cb commit 54f208f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/include/OpenImageIO/typedesc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ template<> struct BaseTypeFromC<uint64_t> { static constexpr TypeDesc::BASETYPE
409409
template<> struct BaseTypeFromC<const uint64_t> { static constexpr TypeDesc::BASETYPE value = TypeDesc::UINT64; };
410410
template<> struct BaseTypeFromC<int64_t> { static constexpr TypeDesc::BASETYPE value = TypeDesc::INT64; };
411411
template<> struct BaseTypeFromC<const int64_t> { static constexpr TypeDesc::BASETYPE value = TypeDesc::INT64; };
412-
#if defined(__GNUC__) && __WORDSIZE == 64 && !(defined(__APPLE__) && defined(__MACH__)) || defined(__NetBSD__)
412+
#if defined(__GNUC__) && (ULONG_MAX == 0xffffffffffffffff) && !(defined(__APPLE__) && defined(__MACH__)) || defined(__NetBSD__)
413413
// Some platforms consider int64_t and long long to be different types, even
414414
// though they are actually the same size.
415415
static_assert(!std::is_same_v<unsigned long long, uint64_t>);

0 commit comments

Comments
 (0)