From 40bc7163fbe1e7e30bb14b833899fc37230482f3 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 5 May 2020 19:16:30 -0700 Subject: [PATCH] Move FMT_MAYBE_UNUSED to where it's actually used --- include/fmt/core.h | 22 +++++++--------------- include/fmt/format.h | 8 ++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index a3307489..6fd2a3f6 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -148,14 +148,6 @@ # define FMT_NORETURN #endif -#ifndef FMT_MAYBE_UNUSED -# if FMT_HAS_CPP17_ATTRIBUTE(maybe_unused) -# define FMT_MAYBE_UNUSED [[maybe_unused]] -# else -# define FMT_MAYBE_UNUSED -# endif -#endif - #ifndef FMT_DEPRECATED # if FMT_HAS_CPP14_ATTRIBUTE(deprecated) || FMT_MSC_VER >= 1900 # define FMT_DEPRECATED [[deprecated]] @@ -170,6 +162,13 @@ # endif #endif +// Workaround broken [[deprecated]] in the Intel, PGI and NVCC compilers. +#if FMT_ICC_VERSION || defined(__PGI) || FMT_NVCC +# define FMT_DEPRECATED_ALIAS +#else +# define FMT_DEPRECATED_ALIAS FMT_DEPRECATED +#endif + #ifndef FMT_INLINE # if FMT_GCC_VERSION && FMT_USE_CONSTEXPR # define FMT_INLINE inline __attribute__((always_inline)) @@ -178,13 +177,6 @@ # endif #endif -// Workaround broken [[deprecated]] in the Intel, PGI and NVCC compilers. -#if FMT_ICC_VERSION || defined(__PGI) || FMT_NVCC -# define FMT_DEPRECATED_ALIAS -#else -# define FMT_DEPRECATED_ALIAS FMT_DEPRECATED -#endif - #ifndef FMT_BEGIN_NAMESPACE # if FMT_HAS_FEATURE(cxx_inline_namespaces) || FMT_GCC_VERSION >= 404 || \ FMT_MSC_VER >= 1900 diff --git a/include/fmt/format.h b/include/fmt/format.h index 27dd5d24..42da5be9 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -88,6 +88,14 @@ # define FMT_FALLTHROUGH #endif +#ifndef FMT_MAYBE_UNUSED +# if FMT_HAS_CPP17_ATTRIBUTE(maybe_unused) +# define FMT_MAYBE_UNUSED [[maybe_unused]] +# else +# define FMT_MAYBE_UNUSED +# endif +#endif + #ifndef FMT_THROW # if FMT_EXCEPTIONS # if FMT_MSC_VER || FMT_NVCC