From 6d8339dd97afea4633e54ed4b42307aff4386040 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 14 Sep 2017 15:50:33 -0600 Subject: Fix #444 - Use BENCHMARK_HAS_CXX11 over __cplusplus. (#446) * Fix #444 - Use BENCHMARK_HAS_CXX11 over __cplusplus. MSVC incorrectly defines __cplusplus to report C++03, despite the compiler actually providing C++11 or greater. Therefore we have to detect C++11 differently for MSVC. This patch uses `_MSVC_LANG` which has been defined since Visual Studio 2015 Update 3; which should be sufficient for detecting C++11. Secondly this patch changes over most usages of __cplusplus >= 201103L to check BENCHMARK_HAS_CXX11 instead. * remove redunant comment --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 5318f7a..fb5af79 100644 --- a/README.md +++ b/README.md @@ -185,7 +185,7 @@ BENCHMARK_TEMPLATE(BM_Sequential, WaitQueue)->Range(1<<0, 1<<10); Three macros are provided for adding benchmark templates. ```c++ -#if __cplusplus >= 201103L // C++11 and greater. +#ifdef BENCHMARK_HAS_CXX11 #define BENCHMARK_TEMPLATE(func, ...) // Takes any number of parameters. #else // C++ < C++11 #define BENCHMARK_TEMPLATE(func, arg1) -- cgit v1.2.3