Enable C++11 math function in a more conservative manner.

This commit is contained in:
Gael Guennebaud
2015-06-11 21:45:02 +02:00
parent 916ef52fff
commit 84d103bee8
2 changed files with 14 additions and 11 deletions

View File

@@ -415,12 +415,15 @@
#define EIGEN_HAS_CONSTEXPR 1
#endif
// Does the compiler support C99 math?
// Does the compiler support C++11 math?
// Let's be conservative and enable the default C++11 implementation only if we are sure it exists
#if (__cplusplus >= 201103L) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC) \
&& (EIGEN_ARCH_i386_OR_x86_64) && (EIGEN_OS_GNULINUX || EIGEN_OS_WIN_STRICT || EIGEN_OS_MAC) || \
(EIGEN_COMP_GNUC_STRICT || (EIGEN_COMP_ICC && EIGEN_COMP_GNUC) || (EIGEN_COMP_CLANG) || (EIGEN_COMP_MSVC >= 1800))
#define EIGEN_HAS_C99_MATH 1
#ifndef EIGEN_HAS_CXX11_MATH
#if (__cplusplus >= 201103L) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC) \
&& (EIGEN_ARCH_i386_OR_x86_64) && (EIGEN_OS_GNULINUX || EIGEN_OS_WIN_STRICT || EIGEN_OS_MAC)
#define EIGEN_HAS_CXX11_MATH 1
#else
#define EIGEN_HAS_CXX11_MATH 0
#endif
#endif
/** Allows to disable some optimizations which might affect the accuracy of the result.