Skip to content

Commit

Permalink
Simplify pragma
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Sep 12, 2024
1 parent b90b4bc commit 89999f1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions include/fmt/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,22 +215,21 @@
# 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

#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
Expand Down

0 comments on commit 89999f1

Please sign in to comment.