From 327a8f8b5a850167901a92747767e14ffe77c03b Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Sat, 14 Apr 2018 16:47:53 +0200 Subject: Collect custom C99 math functions in proj_math.h We are relying more and more on C99 math functions. On C89 systems where those functions are not available our own custom versions of those functions are used instead. So far these has been spread across the code base. This commit gathers them in the same file and introduces the proj_math.h header. The build system checks for C99 math functions. If not found the proj_math.h header make sure that C99 functions are defined as their pj_ equivalent. Ideally proj_math.h is included instead of math.h. This removes the need for any checks against HAVE_C99_MATH in the code making it easier to read. For this commit the functions hypot, log1p and asinh has been taken care of. --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 269225a5..e89961eb 100644 --- a/configure.ac +++ b/configure.ac @@ -45,7 +45,8 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM( [int q; return (int)(hypot(3.0, 4.0) + atanh(0.8) + cbrt(8.0) + remquo(100.0, 90.0, &q) + - remainder(100.0, 90.0) + copysign(1.0, -0.0)) + + remainder(100.0, 90.0) + copysign(1.0, -0.0) + + log1p(0.1) + asinh(0.1)) + isnan(0.0);])], [AC_MSG_RESULT([yes]);C99_MATH="-DHAVE_C99_MATH=1"], [AC_MSG_RESULT([no]);C99_MATH="-DHAVE_C99_MATH=0"]) -- cgit v1.2.3