diff options
author | Antonio Sanchez <cantonios@google.com> | 2021-03-01 15:57:22 -0800 |
---|---|---|
committer | Rasmus Munk Larsen <rmlarsen@google.com> | 2021-03-05 18:33:18 +0000 |
commit | 2468253c9adbb1e42be9227848c2d9a7b578dbaf (patch) | |
tree | b35b5e33db3cc2010c77999c2252261a119ed16b /unsupported/test | |
parent | 82d61af3a490154ad1c0ae2fe00c561095854897 (diff) |
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
Diffstat (limited to 'unsupported/test')
-rw-r--r-- | unsupported/test/special_packetmath.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/unsupported/test/special_packetmath.cpp b/unsupported/test/special_packetmath.cpp index 4f426eb8a..31233f1b0 100644 --- a/unsupported/test/special_packetmath.cpp +++ b/unsupported/test/special_packetmath.cpp @@ -114,7 +114,7 @@ template<typename Scalar,typename Packet> void packetmath_real() Scalar(std::pow(Scalar(10), internal::random<Scalar>(Scalar(-1),Scalar(2)))); } -#if EIGEN_HAS_C99_MATH && (__cplusplus > 199711L) +#if EIGEN_HAS_C99_MATH && (EIGEN_COMP_CXXVER >= 11) CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasLGamma, std::lgamma, internal::plgamma); CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasErf, std::erf, internal::perf); CHECK_CWISE1_IF(internal::packet_traits<Scalar>::HasErfc, std::erfc, internal::perfc); |