From ac90527da5c5bdeb0c9c846996b8d39ff6f03800 Mon Sep 17 00:00:00 2001 From: Francisco Ferreira Date: Wed, 22 Jun 2016 14:34:25 +0100 Subject: [PATCH] AP_Common: change check from GCC version to glibc version (and Cygwin) --- libraries/AP_Common/missing/cmath | 38 ++++++++++++++++++------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/libraries/AP_Common/missing/cmath b/libraries/AP_Common/missing/cmath index 69f6e7bd96..c18b41962a 100644 --- a/libraries/AP_Common/missing/cmath +++ b/libraries/AP_Common/missing/cmath @@ -3,23 +3,29 @@ #include_next #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 +# ifdef __GLIBC__ +# if __GLIBC_PREREQ(2, 23) +# define GLIBC_FIX_NEEDED 1 +# else +# define GLIBC_FIX_NEEDED 0 # endif -# undef _GCC_VERSION +# else +# define GLIBC_FIX_NEEDED 0 +# endif +# if GLIBC_FIX_NEEDED || defined (__CYGWIN__) +# 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 +# undef GLIBC_FIX_NEEDED # endif #endif