bug #1136: Protect isinf for Intel compilers. Also don't distinguish GCC from ICC and don't rely on EIGEN_NOT_A_MACRO, which might not be defined when including this.

This commit is contained in:
Christoph Hertzberg 2015-12-15 11:34:52 +01:00
parent 17352e2792
commit 92655e7215

View File

@ -72,14 +72,12 @@
#define MPREAL_VERSION_STRING "3.6.2" #define MPREAL_VERSION_STRING "3.6.2"
// Detect compiler using signatures from http://predef.sourceforge.net/ // Detect compiler using signatures from http://predef.sourceforge.net/
#if defined(__GNUC__) && defined(__INTEL_COMPILER) #if defined(__GNUC__)
#define IsInf(x) isinf(x) // Intel ICC compiler on Linux #define IsInf(x) (isinf)(x) // GNU C++/Intel ICC compiler on Linux
#elif defined(_MSC_VER) // Microsoft Visual C++ #elif defined(_MSC_VER) // Microsoft Visual C++
#define IsInf(x) (!_finite(x)) #define IsInf(x) (!_finite(x))
#else #else
#define IsInf(x) std::isinf EIGEN_NOT_A_MACRO (x) // GNU C/C++ (and/or other compilers), just hope for C99 conformance #define IsInf(x) (std::isinf)(x) // GNU C/C++ (and/or other compilers), just hope for C99 conformance
#endif #endif
// A Clang feature extension to determine compiler features. // A Clang feature extension to determine compiler features.