From b90b4bc981ece26c31283ce18f9d50d38d600b60 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 11 Sep 2024 18:30:05 -0700 Subject: [PATCH] Remove FMT_STATIC_THOUSANDS_SEPARATOR in favor of FMT_USE_LOCALE --- include/fmt/base.h | 8 ++------ include/fmt/format-inl.h | 4 +--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index d10242c5..f8793aec 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -2286,12 +2286,8 @@ struct is_output_iterator< void_t&>()++ = std::declval())>> : std::true_type {}; -#ifdef FMT_USE_LOCALE -// Use the provided definition. -#elif defined(FMT_STATIC_THOUSANDS_SEPARATOR) || FMT_OPTIMIZE_SIZE > 1 -# define FMT_USE_LOCALE 0 -#else -# define FMT_USE_LOCALE 1 +#ifndef FMT_USE_LOCALE +# define FMT_USE_LOCALE (FMT_OPTIMIZE_SIZE <= 1) #endif // A type-erased reference to an std::locale to avoid a heavy include. diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index d0e97df0..bc8730c4 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -24,8 +24,6 @@ #if FMT_USE_LOCALE # include -#elif !defined(FMT_STATIC_THOUSANDS_SEPARATOR) -# define FMT_STATIC_THOUSANDS_SEPARATOR ',' #endif FMT_BEGIN_NAMESPACE @@ -90,7 +88,7 @@ locale_ref::locale_ref(const Locale& loc) : locale_(&loc) { struct locale {}; template struct numpunct { auto grouping() const -> std::string { return "\03"; } - auto thousands_sep() const -> Char { return FMT_STATIC_THOUSANDS_SEPARATOR; } + auto thousands_sep() const -> Char { return ','; } auto decimal_point() const -> Char { return '.'; } }; template Facet use_facet(locale) { return {}; }