diff options
Diffstat (limited to 'opentrack-logic')
-rw-r--r-- | opentrack-logic/nan.hpp | 9 | ||||
-rw-r--r-- | opentrack-logic/tracker.cpp | 8 |
2 files changed, 10 insertions, 7 deletions
diff --git a/opentrack-logic/nan.hpp b/opentrack-logic/nan.hpp new file mode 100644 index 00000000..c17cabfd --- /dev/null +++ b/opentrack-logic/nan.hpp @@ -0,0 +1,9 @@ +#pragma once + +#if defined(__GNUC__) +bool __attribute__ ((noinline)) nanp(double value); +#elif defined(_WIN32) +__declspec(noinline) bool nanp(double value); +#else +bool nanp(double value); +#endif diff --git a/opentrack-logic/tracker.cpp b/opentrack-logic/tracker.cpp index 1b91eb3e..2ac04d03 100644 --- a/opentrack-logic/tracker.cpp +++ b/opentrack-logic/tracker.cpp @@ -63,13 +63,7 @@ void Tracker::t_compensate(const rmat& rmat, const double* xyz, double* output, output[0] = -ret(1); } -#ifdef _WIN32 -__declspec(noinline) bool nanp(double value); -#elif defined(__GNUC__) -bool __attribute__ ((noinline)) nanp(double value); -#else -bool nanp(double value); -#endif +#include "nan.hpp" static inline double elide_nan(double value, double def) { |