diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2018-04-14 16:47:53 +0200 |
|---|---|---|
| committer | Kristian Evers <kristianevers@gmail.com> | 2018-04-16 22:55:06 +0200 |
| commit | 327a8f8b5a850167901a92747767e14ffe77c03b (patch) | |
| tree | c1681555e256f97258b8624f2190b813c7fdd2c2 /configure.ac | |
| parent | ee22447de347c78944af849b10e0c9fd10184c28 (diff) | |
| download | PROJ-327a8f8b5a850167901a92747767e14ffe77c03b.tar.gz PROJ-327a8f8b5a850167901a92747767e14ffe77c03b.zip | |
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.
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 3 |
1 files changed, 2 insertions, 1 deletions
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"]) |
