From a9b804e18c811c781a099a70b960f5bbde61257d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 18 Jul 2016 12:14:51 +0200 Subject: some: replace hardcoded pi values with the same pi constant We can't depend on M_PI existing after including cmath. --- opentrack-logic/tracker.cpp | 2 +- opentrack-logic/tracker.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'opentrack-logic') diff --git a/opentrack-logic/tracker.cpp b/opentrack-logic/tracker.cpp index 10512059..4fcce853 100644 --- a/opentrack-logic/tracker.cpp +++ b/opentrack-logic/tracker.cpp @@ -108,7 +108,7 @@ void Tracker::logic() m(5).opts.invert, }; - static constexpr double pi = 3.141592653; + static constexpr double pi = OPENTRACK_PI; static constexpr double r2d = 180. / pi; static constexpr double d2r = pi / 180.; diff --git a/opentrack-logic/tracker.h b/opentrack-logic/tracker.h index 1c29fb8d..618de409 100644 --- a/opentrack-logic/tracker.h +++ b/opentrack-logic/tracker.h @@ -10,6 +10,7 @@ #include +#include "opentrack-compat/pi-constant.hpp" #include "opentrack-compat/timer.hpp" #include "opentrack/plugin-support.hpp" #include "mappings.hpp" @@ -28,7 +29,7 @@ class Pose { private: - static constexpr double pi = 3.141592653; + static constexpr double pi = OPENTRACK_PI; static constexpr double d2r = pi/180.0; static constexpr double r2d = 180./pi; -- cgit v1.2.3