better test for hyperbolics

This commit is contained in:
John Cupitt 2021-11-02 23:03:05 +00:00
parent c6d863f9d3
commit 4b7915994f
2 changed files with 3 additions and 13 deletions

View File

@ -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)

View File

@ -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 ))