From 265cc18843ce178dd16a64f3c45e934c53a17ffe Mon Sep 17 00:00:00 2001 From: Kamil-Goras-Mobica <141216953+kamil-goras-mobica@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:55:57 +0100 Subject: [PATCH] Corrected build under msvc compiler #1833 (#2121) Fixes #1833 according to task description. --- test_common/harness/compat.h | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) 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);