Skip to content

Commit

Permalink
Cleanup pragma detection
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Sep 18, 2024
1 parent 5c926d9 commit 55a0a9c
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions include/fmt/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,25 +215,20 @@
# define FMT_VISIBILITY(value)
#endif

// Detect pragmas.
#define FMT_PRAGMA_IMPL(x) _Pragma(#x)
#ifdef FMT_PRAGMA_GCC
// Use the provided definition.
#elif FMT_GCC_VERSION >= 504 && !defined(__NVCOMPILER)
#if 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_PRAGMA_GCC(x) FMT_PRAGMA_IMPL(GCC x)
#else
# define FMT_PRAGMA_GCC(x)
#endif

#ifdef FMT_PRAGMA_CLANG
// Use the provided definition.
#elif FMT_CLANG_VERSION
#if FMT_CLANG_VERSION
# define FMT_PRAGMA_CLANG(x) FMT_PRAGMA_IMPL(clang x)
#else
# define FMT_PRAGMA_CLANG(x)
#endif

#if FMT_MSC_VERSION
# define FMT_MSC_WARNING(...) __pragma(warning(__VA_ARGS__))
#else
Expand Down

0 comments on commit 55a0a9c

Please sign in to comment.