From 89999f16722e9f338426a985327179215bb27936 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 11 Sep 2024 18:52:56 -0700 Subject: [PATCH] Simplify pragma --- include/fmt/base.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index f8793aec..fb3a23ef 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -215,13 +215,13 @@ # define FMT_VISIBILITY(value) #endif +#define FMT_PRAGMA_IMPL(x) _Pragma(#x) #ifdef FMT_GCC_PRAGMA // Use the provided definition. #elif FMT_GCC_VERSION >= 504 && !defined(__NVCOMPILER) // Workaround a _Pragma bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59884 // and an nvhpc warning: https://github.com/fmtlib/fmt/pull/2582. -# define FMT_GCC_PRAGMA_IMPL(x) _Pragma(#x) -# define FMT_GCC_PRAGMA(x) FMT_GCC_PRAGMA_IMPL(GCC x) +# define FMT_GCC_PRAGMA(x) FMT_PRAGMA_IMPL(GCC x) #else # define FMT_GCC_PRAGMA(x) #endif @@ -229,8 +229,7 @@ #ifdef FMT_CLANG_PRAGMA // Use the provided definition. #elif FMT_CLANG_VERSION -# define FMT_CLANG_PRAGMA_IMPL(x) _Pragma(#x) -# define FMT_CLANG_PRAGMA(x) FMT_CLANG_PRAGMA_IMPL(clang x) +# define FMT_CLANG_PRAGMA(x) FMT_PRAGMA_IMPL(clang x) #else # define FMT_CLANG_PRAGMA(x) #endif