diff --git a/test_common/harness/compat.h b/test_common/harness/compat.h index e8a3047e..150c4364 100644 --- a/test_common/harness/compat.h +++ b/test_common/harness/compat.h @@ -112,12 +112,19 @@ int feclearexcept(int excepts); #if defined(__INTEL_COMPILER) #include -#elif __cplusplus && defined(_MSC_VER) -#include #else #include #endif +#ifdef __cplusplus +#include +extern "C" { +using std::isfinite; +using std::isinf; +using std::isnan; +} +#endif + #ifndef M_PI #define M_PI 3.14159265358979323846264338327950288 #endif @@ -140,18 +147,6 @@ extern "C" { #define INFINITY (FLT_MAX + FLT_MAX) #endif -#ifndef isfinite -#define isfinite(x) _finite(x) -#endif - -#ifndef isnan -#define isnan(x) ((x) != (x)) -#endif - -#ifndef isinf -#define isinf(_x) ((_x) == INFINITY || (_x) == -INFINITY) -#endif - #if _MSC_VER < 1900 && !defined(__INTEL_COMPILER) double rint(double x);