From 1d9d8e6f9b0c2ed930ea1c8996f5fb398b3cf322 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 12 Jan 2016 12:14:53 +0100 Subject: [PATCH] Use a slight ifdef hack to let things default to C++11 for most platforms --- matrix/helper_functions.hpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/matrix/helper_functions.hpp b/matrix/helper_functions.hpp index 284644657a..96d2b82751 100644 --- a/matrix/helper_functions.hpp +++ b/matrix/helper_functions.hpp @@ -1,8 +1,14 @@ #pragma once #include "math.hpp" -#include +// grody hack - this should go once C++11 is supported +// on all platforms. +#ifdef __PX4_NUTTX +#include +#else +#include +#endif namespace matrix { @@ -10,7 +16,11 @@ namespace matrix template Type wrap_pi(Type x) { - if (!isfinite(Type(x))) { +#ifdef __PX4_NUTTX + if (!isfinite(x)) { +#else + if (!std::isfinite(x)) { +#endif return x; }