Check gcc version for diagnostic once.

This commit is contained in:
Victor Zverovich 2013-11-16 07:19:41 -08:00
parent 16cb991fd8
commit d49845510e

View File

@ -56,12 +56,11 @@
# define FMT_NOEXCEPT(expr) # define FMT_NOEXCEPT(expr)
#endif #endif
#ifdef __GNUC__
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
# define FMT_GCC_DIAGNOSTIC
# pragma GCC diagnostic push # pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wlong-long" # pragma GCC diagnostic ignored "-Wlong-long"
#endif #endif
#endif
namespace fmt { namespace fmt {
@ -1235,10 +1234,8 @@ inline Formatter<Write> Print(StringRef format) {
} }
} }
#ifdef __GNUC__ #ifdef FMT_GCC_DIAGNOSTIC
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
# pragma GCC diagnostic pop # pragma GCC diagnostic pop
#endif #endif
#endif
#endif // FORMAT_H_ #endif // FORMAT_H_