Browse Source

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.
master
Lucas De Marchi 9 years ago
parent
commit
c4306de122
  1. 11
      libraries/AP_Common/missing/cmath

11
libraries/AP_Common/missing/cmath

@ -2,8 +2,10 @@
#include_next <cmath> #include_next <cmath>
#ifdef __CYGWIN__ #ifndef WAF_BUILD
// hack to get SITL on windows working # ifdef __GNUG__
# define _GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
# if _GCC_VERSION >= 50300
# ifndef HAVE_CMATH_ISFINITE # ifndef HAVE_CMATH_ISFINITE
# define HAVE_CMATH_ISFINITE # define HAVE_CMATH_ISFINITE
# define NEED_CMATH_ISFINITE_STD_NAMESPACE # define NEED_CMATH_ISFINITE_STD_NAMESPACE
@ -16,7 +18,10 @@
# define HAVE_CMATH_ISNAN # define HAVE_CMATH_ISNAN
# define NEED_CMATH_ISNAN_STD_NAMESPACE # define NEED_CMATH_ISNAN_STD_NAMESPACE
# endif # endif
#endif // __CYGWIN__ # endif
# undef _GCC_VERSION
# endif
#endif
#if defined(HAVE_CMATH_ISFINITE) && defined(NEED_CMATH_ISFINITE_STD_NAMESPACE) #if defined(HAVE_CMATH_ISFINITE) && defined(NEED_CMATH_ISFINITE_STD_NAMESPACE)
using std::isfinite; using std::isfinite;

Loading…
Cancel
Save