diff options
author | unknown <msvensson@pilot.blaudden> | 2007-05-16 10:10:02 +0200 |
---|---|---|
committer | unknown <msvensson@pilot.blaudden> | 2007-05-16 10:10:02 +0200 |
commit | 9e1585ab8f487222a03e017079efadb570817657 (patch) | |
tree | 222a34ab17c278e1e03ef3231ddf4cf2cdecf09b /sql/item_func.cc | |
parent | e9e6b9e477fbb5920ba929e0851eb0d4e50ec7aa (diff) | |
download | mariadb-git-9e1585ab8f487222a03e017079efadb570817657.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 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 14a4c4dcf4b..adb512ec0e9 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1980,9 +1980,9 @@ double my_double_round(double value, longlong dec, bool dec_unsigned, 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) { |