AP_Common: change check from GCC version to glibc version (and Cygwin)

This commit is contained in:
Francisco Ferreira 2016-06-22 14:34:25 +01:00 committed by Andrew Tridgell
parent eb44d75ed8
commit ac90527da5
1 changed files with 22 additions and 16 deletions

View File

@ -3,23 +3,29 @@
#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
# 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