Below is the list of changes that have just been committed into a local
5.0 repository of kaa. When kaa does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-05-08 21:11:46+04:00, kaa@stripped +4 -0
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@stripped, 2007-05-08 21:11:42+04:00, kaa@stripped +13 -5
Added a check to define HAVE_ISINF only if it can be used in C++ code as well.
include/my_global.h@stripped, 2007-05-08 21:11:42+04:00, kaa@stripped +5 -6
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@stripped, 2007-05-08 21:11:42+04:00, kaa@stripped +2 -2
Replaced isinf() with my_isinf().
strings/strtod.c@stripped, 2007-05-08 21:11:42+04:00, kaa@stripped +1 -1
Replaced isinf() with my_isinf().
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: kaa
# Host: polly.local
# Root: /home/kaa/src/maint/bug28240/my50-bug24240
--- 1.441/configure.in 2007-04-26 18:06:40 +04:00
+++ 1.442/configure.in 2007-05-08 21:11:42 +04:00
@@ -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"
--- 1.25/strings/strtod.c 2006-12-15 01:53:00 +03:00
+++ 1.26/strings/strtod.c 2007-05-08 21:11:42 +04:00
@@ -194,7 +194,7 @@ double my_strtod(const char *str, char *
done:
*end_ptr= (char*) str; /* end of number */
- if (overflow || isinf(result))
+ if (overflow || my_isinf(result))
{
result= DBL_MAX;
*error= EOVERFLOW;
--- 1.336/sql/item_func.cc 2007-04-28 23:25:27 +04:00
+++ 1.337/sql/item_func.cc 2007-05-08 21:11:42 +04:00
@@ -1980,9 +1980,9 @@ double my_double_round(double value, lon
tmp=(abs_dec < array_elements(log_10) ?
log_10[abs_dec] : pow(10.0,(double) abs_dec));
- if (dec_negative && isinf(tmp))
+ if (dec_negative && my_isinf(tmp))
tmp2= 0;
- else if (!dec_negative && isinf(value * tmp))
+ else if (!dec_negative && my_isinf(value * tmp))
tmp2= value;
else if (truncate)
{
--- 1.140/include/my_global.h 2007-04-29 16:57:14 +04:00
+++ 1.141/include/my_global.h 2007-05-08 21:11:42 +04:00
@@ -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. */
| Thread |
|---|
| • bk commit into 5.0 tree (kaa:1.2476) BUG#28240 | Alexey Kopytov | 8 May |