mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 08:38:36 -04:00
AP_Common: fix build on windows
The way the build was fixed for gcc >= 5.3 breaks the build for older compiler versions on waf. Fix this by ifdef'ing for WAF_BUILD and checking the compiler version.
This commit is contained in:
parent
11e508e3a6
commit
c4306de122
@ -2,21 +2,26 @@
|
||||
|
||||
#include_next <cmath>
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
// hack to get SITL on windows working
|
||||
#ifndef HAVE_CMATH_ISFINITE
|
||||
#define HAVE_CMATH_ISFINITE
|
||||
#define NEED_CMATH_ISFINITE_STD_NAMESPACE
|
||||
#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
|
||||
#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 // __CYGWIN__
|
||||
|
||||
#if defined(HAVE_CMATH_ISFINITE) && defined(NEED_CMATH_ISFINITE_STD_NAMESPACE)
|
||||
using std::isfinite;
|
||||
|
Loading…
Reference in New Issue
Block a user