diff --git a/include/fmt/format.h b/include/fmt/format.h index 537bd9c4..9970444c 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -69,7 +69,6 @@ # define FMT_NOINLINE #endif -// Special definition specific to GCC only #if FMT_GCC_VERSION # define FMT_GCC_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) #else @@ -120,10 +119,10 @@ FMT_END_NAMESPACE # define FMT_THROW(x) throw x # endif # else -# define FMT_THROW(x) \ - do { \ - static_cast(x); \ - FMT_ASSERT(false, ""); \ +# define FMT_THROW(x) \ + do { \ + static_cast(x); \ + FMT_ASSERT(false, ""); \ } while (false) # endif #endif @@ -3205,19 +3204,18 @@ FMT_CONSTEXPR basic_string_view compile_string_to_view( return {s.data(), s.size()}; } -#define FMT_STRING_IMPL(s, base) \ - [] { \ - /* Use a hidden visibility as workaround for some GCC, see */ \ - /* https://github.com/fmtlib/fmt/issues/1973 for details */ \ - /* Use a macro-like name to avoid shadowing warnings. */ \ - struct FMT_GCC_VISIBILITY_HIDDEN FMT_COMPILE_STRING : base { \ - using char_type = fmt::remove_cvref_t; \ - FMT_MAYBE_UNUSED FMT_CONSTEXPR \ - operator fmt::basic_string_view() const { \ - return fmt::detail::compile_string_to_view(s); \ - } \ - }; \ - return FMT_COMPILE_STRING(); \ +#define FMT_STRING_IMPL(s, base) \ + [] { \ + /* Use the hidden visibility as a workaround for a GCC bug (#1973). */ \ + /* Use a macro-like name to avoid shadowing warnings. */ \ + struct FMT_GCC_VISIBILITY_HIDDEN FMT_COMPILE_STRING : base { \ + using char_type = fmt::remove_cvref_t; \ + FMT_MAYBE_UNUSED FMT_CONSTEXPR \ + operator fmt::basic_string_view() const { \ + return fmt::detail::compile_string_to_view(s); \ + } \ + }; \ + return FMT_COMPILE_STRING(); \ }() /**