From 2468253c9adbb1e42be9227848c2d9a7b578dbaf Mon Sep 17 00:00:00 2001 From: Antonio Sanchez Date: Mon, 1 Mar 2021 15:57:22 -0800 Subject: Define EIGEN_CPLUSPLUS and replace most __cplusplus checks. The macro `__cplusplus` is not defined correctly in MSVC unless building with the the `/Zc:__cplusplus` flag. Instead, it defines `_MSVC_LANG` to the specified c++ standard version number. Here we introduce `EIGEN_CPLUSPLUS` which will contain the c++ version number both for MSVC and otherwise. This simplifies checks for supported features. Also replaced most instances of standard version checking via `__cplusplus` with the existing `EIGEN_COMP_CXXVER` macro for better clarity. Fixes: #2170 --- test/packetmath.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/packetmath.cpp') diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 4ff193ee4..f5cce6436 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -761,7 +761,7 @@ void packetmath_real() { } } -#if EIGEN_HAS_C99_MATH && (__cplusplus > 199711L) +#if EIGEN_HAS_C99_MATH && (EIGEN_COMP_CXXVER >= 11) data1[0] = std::numeric_limits::infinity(); data1[1] = Scalar(-1); CHECK_CWISE1_IF(PacketTraits::HasLog1p, std::log1p, internal::plog1p); -- cgit v1.2.3