mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
Use a slight ifdef hack to let things default to C++11 for most platforms
This commit is contained in:
parent
187830164d
commit
1d9d8e6f9b
@ -1,8 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#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
|
||||
{
|
||||
@ -10,7 +16,11 @@ namespace matrix
|
||||
template<typename Type>
|
||||
Type wrap_pi(Type x)
|
||||
{
|
||||
if (!isfinite(Type(x))) {
|
||||
#ifdef __PX4_NUTTX
|
||||
if (!isfinite(x)) {
|
||||
#else
|
||||
if (!std::isfinite(x)) {
|
||||
#endif
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user