commit fa632b0019ad32dc1e45143d1f95cb91e32a00fc Author: Peter TB Brett Date: Wed Sep 21 05:37:44 2016 +0100 build: Ensure config.h does not undefine `sqrtf` On Windows, `sqrtf` is a macro. Previously, `configure` was detecting `sqrtf`'s availability, but then undefining it in `config.h`, resulting in link failures. This patch modifies `configure` to use `HAVE_SQRTF` as a feature macro for the `sqrtf()` function, and adds an additional stanza to `config.h` which defines a suitable alternative when `HAVE_SQRTF` is not defined. Signed-off-by: Peter TB Brett diff --git a/configure.ac b/configure.ac index e833e45..b70e32d 100644 --- a/configure.ac +++ b/configure.ac @@ -932,9 +932,16 @@ fi dnl ===================================== dnl Check for missing sqrtf() as, e.g., for Solaris 9 -AC_SEARCH_LIBS([sqrtf], [m], [], - [AC_DEFINE([sqrtf], [sqrt], - [Define to sqrt if you do not have the `sqrtf' function.])]) +AC_SEARCH_LIBS([sqrtf], [m], + [AC_DEFINE([HAVE_SQRTF], [1], + [Whether we have sqrtf()])], + []) + +AH_VERBATIM([HAVE_SQRTF_MISSING], + [/* If sqrtf() is missing, use sqrt(). */ +#ifndef HAVE_SQRTF +#define sqrtf sqrt +#endif /* HAVE_SQRTF */]) dnl ===================================== dnl Thread local storage