From d49845510eeb563adc8ffe4f352322476fd2b6f0 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 16 Nov 2013 07:19:41 -0800 Subject: [PATCH] Check gcc version for diagnostic once. --- format.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/format.h b/format.h index 6ab82ace..0c0d7562 100644 --- a/format.h +++ b/format.h @@ -56,12 +56,11 @@ # define FMT_NOEXCEPT(expr) #endif -#ifdef __GNUC__ #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +# define FMT_GCC_DIAGNOSTIC # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wlong-long" #endif -#endif namespace fmt { @@ -1235,10 +1234,8 @@ inline Formatter Print(StringRef format) { } } -#ifdef __GNUC__ -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#ifdef FMT_GCC_DIAGNOSTIC # pragma GCC diagnostic pop #endif -#endif #endif // FORMAT_H_