diff --git a/libc/src/__support/CPP/TypeTraits.h b/libc/src/__support/CPP/TypeTraits.h --- a/libc/src/__support/CPP/TypeTraits.h +++ b/libc/src/__support/CPP/TypeTraits.h @@ -49,8 +49,11 @@ IsSameV || IsSameV || IsSameV || IsSameV || IsSameV || IsSameV || - IsSameV || IsSameV || - IsSameV<__uint128_t, TypeNoCV> || IsSameV<__int128_t, TypeNoCV>; + IsSameV || IsSameV +#ifdef __SIZEOF_INT128__ + || IsSameV<__uint128_t, TypeNoCV> || IsSameV<__int128_t, TypeNoCV> +#endif + ; }; template struct IsPointerTypeNoCV : public FalseValue {}; diff --git a/libc/src/__support/FPUtil/PlatformDefs.h b/libc/src/__support/FPUtil/PlatformDefs.h --- a/libc/src/__support/FPUtil/PlatformDefs.h +++ b/libc/src/__support/FPUtil/PlatformDefs.h @@ -15,8 +15,10 @@ #define X87_FPU #endif +// https://developer.arm.com/documentation/dui0491/i/C-and-C---Implementation-Details/Basic-data-types // https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms -#if defined(_WIN32) || (defined(__APPLE__) && defined(__aarch64__)) +#if defined(_WIN32) || defined(__arm__) || \ + (defined(__APPLE__) && defined(__aarch64__)) #define LONG_DOUBLE_IS_DOUBLE #endif diff --git a/libc/utils/UnitTest/LibcTest.cpp b/libc/utils/UnitTest/LibcTest.cpp --- a/libc/utils/UnitTest/LibcTest.cpp +++ b/libc/utils/UnitTest/LibcTest.cpp @@ -42,6 +42,7 @@ std::string describeValue(std::string Value) { return std::string(Value); } +#ifdef __SIZEOF_INT128__ // When the value is __uint128_t, also show its hexadecimal digits. // Using template to force exact match, prevent ambiguous promotion. std::string describeValue128(__uint128_t Value) { @@ -61,6 +62,7 @@ template <> std::string describeValue<__uint128_t>(__uint128_t Value) { return describeValue128(Value); } +#endif template void explainDifference(ValType LHS, ValType RHS, const char *LHSStr, @@ -218,10 +220,12 @@ const char *RHSStr, const char *File, unsigned long Line); +#ifdef __SIZEOF_INT128__ template bool test<__int128_t>(RunContext *Ctx, TestCondition Cond, __int128_t LHS, __int128_t RHS, const char *LHSStr, const char *RHSStr, const char *File, unsigned long Line); +#endif template bool test(RunContext *Ctx, TestCondition Cond, unsigned char LHS, unsigned char RHS, @@ -253,10 +257,12 @@ const char *LHSStr, const char *RHSStr, const char *File, unsigned long Line); +#ifdef __SIZEOF_INT128__ template bool test<__uint128_t>(RunContext *Ctx, TestCondition Cond, __uint128_t LHS, __uint128_t RHS, const char *LHSStr, const char *RHSStr, const char *File, unsigned long Line); +#endif } // namespace internal