From 94f96d112dba3f55c4bb72ca57e72589e9ea5c2b Mon Sep 17 00:00:00 2001 From: LoveSy Date: Tue, 4 Jun 2024 21:59:53 +0800 Subject: [PATCH] Fix undefined reference when compiling with FMT_STATIC_THOUSANDS_SEPARATOR and chrono.h --- include/fmt/chrono.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index 200c0455..bf83ce00 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -1780,8 +1780,10 @@ class get_locale { public: get_locale(bool localized, locale_ref loc) : has_locale_(localized) { +#ifndef FMT_STATIC_THOUSANDS_SEPARATOR if (localized) ::new (&locale_) std::locale(loc.template get()); +#endif } ~get_locale() { if (has_locale_) locale_.~locale();