mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-04 15:08:28 -04:00
39d4fa2cf8
Revert these commits: "AP_Common: gcc 4.9.2 behaves differently from 4.9.3" "AP_Common: this workaround for missing/cmath is also needed for gcc 4.9.3" This breaks the build for PX4. The change is related to the libc, not the compiler version. We have an workaround there based on compiler version just because it's usual to have a more recent libc version when you have a recent compiler.
37 lines
930 B
Plaintext
37 lines
930 B
Plaintext
#pragma once
|
|
|
|
#include_next <cmath>
|
|
|
|
#ifndef WAF_BUILD
|
|
# ifdef __GNUG__
|
|
# define _GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
|
|
# if _GCC_VERSION >= 50300
|
|
# ifndef HAVE_CMATH_ISFINITE
|
|
# define HAVE_CMATH_ISFINITE
|
|
# define NEED_CMATH_ISFINITE_STD_NAMESPACE
|
|
# endif
|
|
# ifndef HAVE_CMATH_ISINF
|
|
# define HAVE_CMATH_ISINF
|
|
# define NEED_CMATH_ISINF_STD_NAMESPACE
|
|
# endif
|
|
# ifndef HAVE_CMATH_ISNAN
|
|
# define HAVE_CMATH_ISNAN
|
|
# define NEED_CMATH_ISNAN_STD_NAMESPACE
|
|
# endif
|
|
# endif
|
|
# undef _GCC_VERSION
|
|
# endif
|
|
#endif
|
|
|
|
#if defined(HAVE_CMATH_ISFINITE) && defined(NEED_CMATH_ISFINITE_STD_NAMESPACE)
|
|
using std::isfinite;
|
|
#endif
|
|
|
|
#if defined(HAVE_CMATH_ISINF) && defined(NEED_CMATH_ISINF_STD_NAMESPACE)
|
|
using std::isinf;
|
|
#endif
|
|
|
|
#if defined(HAVE_CMATH_ISNAN) && defined(NEED_CMATH_ISNAN_STD_NAMESPACE)
|
|
using std::isnan;
|
|
#endif
|