Add support for built-in __int128 when available

This commit is contained in:
Deniz Evrenci
2019-08-29 19:36:27 +09:00
committed by Victor Zverovich
parent 16e3c48bb0
commit 6de0454b42
7 changed files with 157 additions and 11 deletions

View File

@@ -149,6 +149,17 @@ template <typename T> struct value_extractor {
template <typename U> FMT_NORETURN T operator()(U) {
throw std::runtime_error(fmt::format("invalid type {}", typeid(U).name()));
}
#ifdef __apple_build_version__
// Apple Clang does not define typeid for __int128_t and __uint128_t.
FMT_NORETURN T operator()(__int128_t) {
throw std::runtime_error(fmt::format("invalid type {}", "__int128_t"));
}
FMT_NORETURN T operator()(__uint128_t) {
throw std::runtime_error(fmt::format("invalid type {}", "__uint128_t"));
}
#endif
};
TEST(FormatTest, ArgConverter) {