mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 00:43:34 +08:00
Use a slight ifdef hack to let things default to C++11 for most platforms
This commit is contained in:
@@ -1,8 +1,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "math.hpp"
|
#include "math.hpp"
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
|
// grody hack - this should go once C++11 is supported
|
||||||
|
// on all platforms.
|
||||||
|
#ifdef __PX4_NUTTX
|
||||||
|
#include <math.h>
|
||||||
|
#else
|
||||||
|
#include <cmath>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace matrix
|
namespace matrix
|
||||||
{
|
{
|
||||||
@@ -10,7 +16,11 @@ namespace matrix
|
|||||||
template<typename Type>
|
template<typename Type>
|
||||||
Type wrap_pi(Type x)
|
Type wrap_pi(Type x)
|
||||||
{
|
{
|
||||||
if (!isfinite(Type(x))) {
|
#ifdef __PX4_NUTTX
|
||||||
|
if (!isfinite(x)) {
|
||||||
|
#else
|
||||||
|
if (!std::isfinite(x)) {
|
||||||
|
#endif
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user