forked from fmtlib/fmt
Fix handling of long with FMT_BUILTIN_TYPES=0
This commit is contained in:
@ -1102,7 +1102,7 @@ FMT_CONSTEXPR void init_static_named_arg(named_arg_info<Char>* named_args,
|
||||
|
||||
// To minimize the number of types we need to deal with, long is translated
|
||||
// either to int or to long long depending on its size.
|
||||
enum { long_short = sizeof(long) == sizeof(int) };
|
||||
enum { long_short = sizeof(long) == sizeof(int) && FMT_BUILTIN_TYPES };
|
||||
using long_type = conditional_t<long_short, int, long long>;
|
||||
using ulong_type = conditional_t<long_short, unsigned, unsigned long long>;
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
TEST(no_builtin_types_test, format) {
|
||||
EXPECT_EQ(fmt::format("{}", 42), "42");
|
||||
EXPECT_EQ(fmt::format("{}", 42L), "42");
|
||||
}
|
||||
|
||||
TEST(no_builtin_types_test, double_is_custom_type) {
|
||||
|
Reference in New Issue
Block a user