diff --git a/bench/cpp14formatter.cpp b/bench/cpp14formatter.cpp index 06f3dd66..444c4c1b 100644 --- a/bench/cpp14formatter.cpp +++ b/bench/cpp14formatter.cpp @@ -1,4 +1,4 @@ -#if defined(__cpp_constexpr) && __cpp_constexpr >= 201304 +#if (__GNUC__ >= 6 || defined(__clang__)) && defined(__cpp_constexpr) && __cpp_constexpr >= 201304 #include diff --git a/bench/logger.cpp b/bench/logger.cpp index 4f0fe8f4..14e745f2 100644 --- a/bench/logger.cpp +++ b/bench/logger.cpp @@ -89,7 +89,7 @@ literal_with_args(::benchmark::State& state) { state.SetItemsProcessed(state.iterations()); } -#if defined(__cpp_constexpr) && __cpp_constexpr >= 201304 +#if (__GNUC__ >= 6 || defined(__clang__)) && defined(__cpp_constexpr) && __cpp_constexpr >= 201304 static void literal_with_args_using_cpp14_formatter(::benchmark::State& state) { @@ -282,7 +282,7 @@ NBENCHMARK("log.lit[args: 1]", literal_with_arg); NBENCHMARK("log.lit[args: 6]", literal_with_args); -#if defined(__cpp_constexpr) && __cpp_constexpr >= 201304 +#if (__GNUC__ >= 6 || defined(__clang__)) && defined(__cpp_constexpr) && __cpp_constexpr >= 201304 NBENCHMARK("log.lit[args: 6 + c++14::fmt]", literal_with_args_using_cpp14_formatter); #endif diff --git a/include/blackhole/extensions/facade.hpp b/include/blackhole/extensions/facade.hpp index aa4f94cf..6d386ef7 100644 --- a/include/blackhole/extensions/facade.hpp +++ b/include/blackhole/extensions/facade.hpp @@ -2,7 +2,7 @@ #include -#if defined(__cpp_constexpr) && __cpp_constexpr >= 201304 +#if (__GNUC__ >= 6 || defined(__clang__)) && defined(__cpp_constexpr) && __cpp_constexpr >= 201304 #include "blackhole/extensions/metaformat.hpp" #endif @@ -60,7 +60,7 @@ class logger_facade { template auto log(int severity, const string_view& pattern, const T& arg, const Args&... args) -> void; -#if defined(__cpp_constexpr) && __cpp_constexpr >= 201304 +#if (__GNUC__ >= 6 || defined(__clang__)) && defined(__cpp_constexpr) && __cpp_constexpr >= 201304 /// Log a message with the given severity level and further formatting using the given pattern /// and arguments. /// @@ -114,7 +114,7 @@ logger_facade::log(int severity, const string_view& pattern, const attri inner().log(severity, pattern, pack); } -#if defined(__cpp_constexpr) && __cpp_constexpr >= 201304 +#if (__GNUC__ >= 6 || defined(__clang__)) && defined(__cpp_constexpr) && __cpp_constexpr >= 201304 template template diff --git a/include/blackhole/extensions/metaformat.hpp b/include/blackhole/extensions/metaformat.hpp index cf516b45..1059aa75 100644 --- a/include/blackhole/extensions/metaformat.hpp +++ b/include/blackhole/extensions/metaformat.hpp @@ -9,7 +9,7 @@ using blackhole::stdext::string_view; -#if defined(__cpp_constexpr) && __cpp_constexpr >= 201304 +#if (__GNUC__ >= 6 || defined(__clang__)) && defined(__cpp_constexpr) && __cpp_constexpr >= 201304 constexpr std::size_t diff --git a/tests/src/unit/detail/formatter/string/parser.cpp b/tests/src/unit/detail/formatter/string/parser.cpp index 17d370b0..1f8cd6d2 100644 --- a/tests/src/unit/detail/formatter/string/parser.cpp +++ b/tests/src/unit/detail/formatter/string/parser.cpp @@ -1,5 +1,6 @@ #include +#include #include #include