From 9040b187a1c4fa380f8a12207b9dd6d04b3a10ac Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 12 Aug 2016 18:00:49 +0200 Subject: all: rename modules s#^opentrack-##. and opentrack -> api Adjust usages. --- compat/nan.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 compat/nan.cpp (limited to 'compat/nan.cpp') diff --git a/compat/nan.cpp b/compat/nan.cpp new file mode 100644 index 00000000..899b907a --- /dev/null +++ b/compat/nan.cpp @@ -0,0 +1,17 @@ +#include +#include "export.hpp" + +#if defined(__GNUC__) +extern "C" OPENTRACK_COMPAT_EXPORT bool __attribute__ ((noinline)) nanp(double value) +#elif defined(_WIN32) +extern "C" OPENTRACK_COMPAT_EXPORT __declspec(noinline) bool nanp(double value) +#else +extern "C" OPENTRACK_COMPAT_EXPORT bool nanp(double value) +#endif +{ + using std::isnan; + using std::isinf; + + const volatile double x = value; + return isnan(x) || isinf(x); +} -- cgit v1.2.3