Skip to content

Commit

Permalink
Corrected build under msvc compiler #1833 (#2121)
Browse files Browse the repository at this point in the history
Fixes #1833 according to task description.
  • Loading branch information
kamil-goras-mobica authored Nov 12, 2024
1 parent b149060 commit 265cc18
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions test_common/harness/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,19 @@ int feclearexcept(int excepts);

#if defined(__INTEL_COMPILER)
#include <mathimf.h>
#elif __cplusplus && defined(_MSC_VER)
#include <cmath>
#else
#include <math.h>
#endif

#ifdef __cplusplus
#include <cmath>
extern "C" {
using std::isfinite;
using std::isinf;
using std::isnan;
}
#endif

#ifndef M_PI
#define M_PI 3.14159265358979323846264338327950288
#endif
Expand All @@ -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);
Expand Down

0 comments on commit 265cc18

Please sign in to comment.