Skip to content

Commit

Permalink
Readd FMT_NO_UNIQUE_ADDRESS
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Dec 26, 2024
1 parent 8d517e5 commit feb7212
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
16 changes: 15 additions & 1 deletion include/fmt/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,20 @@
# define FMT_CATCH(x) if (false)
#endif

#ifdef FMT_NO_UNIQUE_ADDRESS
// Use the provided definition.
#elif FMT_CPLUSPLUS < 202002L
// Not supported.
#elif FMT_HAS_CPP_ATTRIBUTE(no_unique_address)
# define FMT_NO_UNIQUE_ADDRESS [[no_unique_address]]
// VS2019 v16.10 and later except clang-cl (https://reviews.llvm.org/D110485).
#elif FMT_MSC_VERSION >= 1929 && !FMT_CLANG_VERSION
# define FMT_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
#endif
#ifndef FMT_NO_UNIQUE_ADDRESS
# define FMT_NO_UNIQUE_ADDRESS
#endif

#if FMT_HAS_CPP17_ATTRIBUTE(fallthrough)
# define FMT_FALLTHROUGH [[fallthrough]]
#elif defined(__clang__)
Expand Down Expand Up @@ -2608,7 +2622,7 @@ class context {
private:
appender out_;
format_args args_;
detail::locale_ref loc_; // DEPRECATED! Should be replaced with a base class.
FMT_NO_UNIQUE_ADDRESS detail::locale_ref loc_;

public:
/// The character type for the output.
Expand Down
14 changes: 0 additions & 14 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,6 @@ FMT_END_NAMESPACE
# endif // FMT_USE_EXCEPTIONS
#endif // FMT_THROW

#ifdef FMT_NO_UNIQUE_ADDRESS
// Use the provided definition.
#elif FMT_CPLUSPLUS < 202002L
// Not supported.
#elif FMT_HAS_CPP_ATTRIBUTE(no_unique_address)
# define FMT_NO_UNIQUE_ADDRESS [[no_unique_address]]
// VS2019 v16.10 and later except clang-cl (https://reviews.llvm.org/D110485).
#elif FMT_MSC_VERSION >= 1929 && !FMT_CLANG_VERSION
# define FMT_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
#endif
#ifndef FMT_NO_UNIQUE_ADDRESS
# define FMT_NO_UNIQUE_ADDRESS
#endif

// Defining FMT_REDUCE_INT_INSTANTIATIONS to 1, will reduce the number of
// integer formatter template instantiations to just one by only using the
// largest integer type. This results in a reduction in binary size but will
Expand Down

0 comments on commit feb7212

Please sign in to comment.