summaryrefslogtreecommitdiffhomepage
path: root/opentrack-compat/nan.cpp
blob: 6c4b1f6d8d0d457cd4288744db247738ef01339e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <cmath>

#if defined(__GNUC__)
extern "C" bool __attribute__ ((noinline)) nanp(double value)
#elif defined(_WIN32)
extern "C" __declspec(noinline) bool nanp(double value)
#else
extern "C" bool nanp(double value)
#endif
{
    using std::isnan;
    using std::isinf;

    const volatile double x = value;
    return isnan(x) || isinf(x);
}