From 4b7915994fce76c7a81f1d522ceb94558d442de3 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 2 Nov 2021 23:03:05 +0000 Subject: [PATCH] better test for hyperbolics --- configure.ac | 1 + libvips/arithmetic/math.c | 15 ++------------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index 6855b794..d8632b7f 100644 --- a/configure.ac +++ b/configure.ac @@ -394,6 +394,7 @@ AC_CHECK_FUNCS([getcwd gettimeofday getwd memset munmap putenv realpath strcasec AC_CHECK_LIB(m,cbrt,[AC_DEFINE(HAVE_CBRT,1,[have cbrt() in libm.])]) AC_CHECK_LIB(m,hypot,[AC_DEFINE(HAVE_HYPOT,1,[have hypot() in libm.])]) AC_CHECK_LIB(m,atan2,[AC_DEFINE(HAVE_ATAN2,1,[have atan2() in libm.])]) +AC_CHECK_LIB(m,asinh,[AC_DEFINE(HAVE_ASINH,1,[have asinh() in libm.])]) # have to have these parts of glib ... we need glib 2.15 for gio PKG_CHECK_MODULES(REQUIRED, glib-2.0 >= 2.40 gmodule-no-export-2.0 gobject-2.0 gio-2.0) diff --git a/libvips/arithmetic/math.c b/libvips/arithmetic/math.c index df37a270..f9fbc3e6 100644 --- a/libvips/arithmetic/math.c +++ b/libvips/arithmetic/math.c @@ -129,20 +129,9 @@ vips_math_build( VipsObject *object ) g_assert_not_reached(); \ } -/* Inverse hyperbolic functions for old compilers. - * - * They were added to the standard in C99 and C++11. +/* If there's asinh, assume we have the other two as well. */ -#if ( \ - (defined( __cplusplus ) && __cplusplus >= 201103L) || \ - (defined( __STDC__ ) && __STDC_VERSION__ >= 199901L) \ -) - #define HAS_INVERSE_HYPERBOLICS 1 -#else - #define HAS_INVERSE_HYPERBOLICS 0 -#endif - -#if HAS_INVERSE_HYPERBOLICS +#if HAVE_ASINH #define ASINH( X ) (asinh( X )) #define ACOSH( X ) (acosh( X )) #define ATANH( X ) (atanh( X ))