summaryrefslogtreecommitdiffhomepage
path: root/opentrack-logic
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-06-28 05:22:42 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-06-28 05:22:42 +0200
commit5e66cd0e2f0103041a37bd8844cb820ca47b41dc (patch)
tree4d29456fe708cae84cc8c1004c602db0183d7b39 /opentrack-logic
parent1d95552b0627c825190fef196d82144cb1ddd502 (diff)
logic/nan: move prototype to header
Diffstat (limited to 'opentrack-logic')
-rw-r--r--opentrack-logic/nan.hpp9
-rw-r--r--opentrack-logic/tracker.cpp8
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)
{