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 | b75500fb4f3f6f0a489f7ae547079a37117ba60b (patch) | |
tree | bfee6cd214d13fed1ef6871b4ba7d00e9e5ef064 /include | |
parent | 42e5474856284aa9886854206d9729a49a01c446 (diff) | |
download | mariadb-git-b75500fb4f3f6f0a489f7ae547079a37117ba60b.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 'include')
-rw-r--r-- | include/my_global.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/my_global.h b/include/my_global.h index e9b371d8d30..f32a987ffb1 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -792,12 +792,11 @@ typedef SOCKET_SIZE_TYPE size_socket; #define isnan(x) ((x) != (x)) #endif -#if !defined(HAVE_ISINF) -/* The configure check for "isinf with math.h" has failed */ -#ifdef isinf -#undef isinf -#endif -#define isinf(X) (!finite(X) && !isnan(X)) +#ifdef HAVE_ISINF +/* isinf() can be used in both C and C++ code */ +#define my_isinf(X) isinf(X) +#else +#define my_isinf(X) (!finite(X) && !isnan(X)) #endif /* Define missing math constants. */ |