diff options
author | unknown <kaa@polly.local> | 2007-05-08 21:11:46 +0400 |
---|---|---|
committer | unknown <kaa@polly.local> | 2007-05-08 21:11:46 +0400 |
commit | 8931efa7e9954a2eb3362ea195e2eb50660b10e2 (patch) | |
tree | bfee6cd214d13fed1ef6871b4ba7d00e9e5ef064 /configure.in | |
parent | 48cdd9fcc1d51c53e2eedb5f79d18bbe32e619d7 (diff) | |
download | mariadb-git-8931efa7e9954a2eb3362ea195e2eb50660b10e2.tar.gz |
Fix for bug #28240: "isinf()" cannot be used in C++ for lack of prototype
Since isinf() portability across various platforms and compilers is a complicated question, we should not use it directly. Instead, the my_isinf() macro should be used, which is defined as an alias to the system-defined isinf() if it is safe to use, or a workaround implementation otherwise.
configure.in:
Added a check to define HAVE_ISINF only if it can be used in C++ code as well.
include/my_global.h:
Define my_isinf() as an alias to isinf(), if it is available in both C and C++ code. Otherwise, define it to a workaround implementation.
sql/item_func.cc:
Replaced isinf() with my_isinf().
strings/strtod.c:
Replaced isinf() with my_isinf().
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/configure.in b/configure.in index 1026c855bf2..e788419eb4f 100644 --- a/configure.in +++ b/configure.in @@ -2006,12 +2006,20 @@ case "$target" in ;; esac -# isinf() could be a function or a macro (HPUX) -AC_MSG_CHECKING(for isinf with <math.h>) +# Check that isinf() is available in math.h and can be used in both C and C++ +# code +AC_MSG_CHECKING(for isinf in <math.h>) AC_TRY_LINK([#include <math.h>], [float f = 0.0; int r = isinf(f); return r], - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function]), - AC_MSG_RESULT(no)) + AC_MSG_RESULT(yes) + AC_MSG_CHECKING(whether isinf() can be used in C++ code) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_LINK([#include <math.h>], [float f = 0.0; int r = isinf(f); return r], + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function]), + AC_MSG_RESULT(no)) + AC_LANG_RESTORE, + AC_MSG_RESULT(no)) CFLAGS="$ORG_CFLAGS" |