From 8dfddcd7dba3752ab44fd9f30cc1533561aabe75 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 20 Sep 2016 22:21:32 +0200 Subject: api/tracker: merge from unstable - fix gimbal lock - use right Tait-Bryan conversion to/from matrix, not generic inapplicable euler conversion - adjust for timer inaccuracy, therefore running at constant Hz that's actually the specified Hz --- opentrack-compat/nan.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 opentrack-compat/nan.cpp (limited to 'opentrack-compat/nan.cpp') diff --git a/opentrack-compat/nan.cpp b/opentrack-compat/nan.cpp new file mode 100644 index 00000000..899b907a --- /dev/null +++ b/opentrack-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