Skip to content

Commit

Permalink
Fix compilation on GCC when -std=c++11 is not specified.
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Dec 10, 2013
1 parent 3d7faaf commit 8ca31c8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions format.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <initializer_list>
#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)
Expand Down

0 comments on commit 8ca31c8

Please sign in to comment.