From 8ca31c8473971023b5868fdd65e6320a69d4e598 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 9 Dec 2013 17:45:27 -0800 Subject: [PATCH] Fix compilation on GCC when -std=c++11 is not specified. --- format.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/format.h b/format.h index 679919ed..a4ff441a 100644 --- a/format.h +++ b/format.h @@ -51,16 +51,19 @@ # define __has_feature(x) 0 #endif -#define FMT_USE_INITIALIZER_LIST \ - (__has_feature(cxx_generalized_initializers) || \ - FMG_GCC_VERSION >= 404 || _MSC_VER >= 1700) +#ifndef FMT_USE_INITIALIZER_LIST +# define FMT_USE_INITIALIZER_LIST \ + (__has_feature(cxx_generalized_initializers) || \ + (FMG_GCC_VERSION >= 404 && __cplusplus >= 201103) || _MSC_VER >= 1700) +#endif #if FMT_USE_INITIALIZER_LIST # include #endif // Define FMT_USE_NOEXCEPT to make format use noexcept (C++11 feature). -#if FMT_USE_NOEXCEPT || __has_feature(cxx_noexcept) || FMG_GCC_VERSION >= 408 +#if FMT_USE_NOEXCEPT || __has_feature(cxx_noexcept) || \ + (FMG_GCC_VERSION >= 408 && __cplusplus >= 201103) # define FMT_NOEXCEPT(expr) noexcept(expr) #else # define FMT_NOEXCEPT(expr)