summaryrefslogtreecommitdiffhomepage
path: root/compat/nan.cpp
blob: a7b3736219ade770a6ffaca31b60b77c6157a54a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "export.hpp"

#if defined(_MSC_VER)
#   include <cmath>
#   define my_isnan std::isnan
#   define my_isinf std::isinf
extern "C" OPENTRACK_COMPAT_EXPORT __declspec(noinline) bool nanp(double x)
#else
int my_isnan(double)__asm__("isnan");
int my_isinf(double)__asm__("isinf");

extern "C" OPENTRACK_COMPAT_EXPORT bool __attribute__ ((noinline)) nanp(double x)
#endif
{
    return my_isnan(x) || my_isinf(x);
}