Date: Thursday, January 25, 2007 @ 22:42:28
Author: marc
Path: /cvsroot/carob/carob
Added: include/C99Math.h (1.1)
Modified: src/ParameterStatement.cpp (1.34 -> 1.35)
test/40-Parameter-PreparedStatement/TestIEEE754.cpp (1.22 ->
1.23)
Externalized signbit/isnan/isinf into new C99Math.h. Implemented
workaround for gcc 3.4 isnan infinite loop (needed on FreeBSD 6.2)
CAROB-117
-----------------------------------------------------+
include/C99Math.h | 26 ++++++++++++++++++
src/ParameterStatement.cpp | 10 +-----
test/40-Parameter-PreparedStatement/TestIEEE754.cpp | 10 +-----
3 files changed, 30 insertions(+), 16 deletions(-)
Index: carob/include/C99Math.h
diff -u /dev/null carob/include/C99Math.h:1.1
--- /dev/null Thu Jan 25 22:42:28 2007
+++ carob/include/C99Math.h Thu Jan 25 22:42:28 2007
@@ -0,0 +1,26 @@
+/**
+ * Warning : these hacks must be included LAST
+ */
+
+// gcc-specific workaroud to get those C99 features.
+// See discussion "Re: C++ header file problem - is this a bug?" at
+// http://gcc.gnu.org/ml/gcc/2005-01/threads.html#00169
+#ifdef __GNUG__
+
+using std::signbit;
+
+#if __GNUC__ == 3 && __GNUC_MINOR__ == 4 // FIXME: check those versions
+
+// To avoid "isnan endless loop" bug:
+// http://www.cygwin.com/ml/cygwin/2006-02/threads.html#00968
+// => do nothing and use C functions misteriously available instead
+
+#else
+
+using std::isinf;
+using std::isnan;
+
+#endif // gcc 3.4
+
+#endif // GNUG
+
Index: carob/src/ParameterStatement.cpp
diff -u carob/src/ParameterStatement.cpp:1.34
carob/src/ParameterStatement.cpp:1.35
--- carob/src/ParameterStatement.cpp:1.34 Thu Jan 25 20:43:41 2007
+++ carob/src/ParameterStatement.cpp Thu Jan 25 22:42:28 2007
@@ -34,14 +34,8 @@
#include <cmath> // C++
#endif
-// gcc-specific workaroud to get those C99 features.
-// See discussion "Re: C++ header file problem - is this a bug?" at
-// http://gcc.gnu.org/ml/gcc/2005-01/threads.html#00169
-#ifdef __GNUC__
-using std::signbit;
-using std::isinf;
-using std::isnan;
-#endif
+#include "C99Math.h" // signbit, isinf, isnan
+
namespace CarobNS {
/**
Index: carob/test/40-Parameter-PreparedStatement/TestIEEE754.cpp
diff -u carob/test/40-Parameter-PreparedStatement/TestIEEE754.cpp:1.22
carob/test/40-Parameter-PreparedStatement/TestIEEE754.cpp:1.23
--- carob/test/40-Parameter-PreparedStatement/TestIEEE754.cpp:1.22 Thu Jan
25 20:53:01 2007
+++ carob/test/40-Parameter-PreparedStatement/TestIEEE754.cpp Thu Jan 25
22:42:28 2007
@@ -27,6 +27,8 @@
#include <limits>
+#include "C99Math.h"
+
// substitute here with the float32_t and float64_t types of your
// favorite DBMS
#define TABLE_TYPE L"(i int, f real, d double precision)"
@@ -43,9 +45,6 @@
#include <iostream>
-#ifndef __MINGW32__
-using std::signbit;
-#endif
#ifdef CAROB_DEBUG_FLOAT
namespace CarobNS {
@@ -93,11 +92,6 @@
}
-// see src/ParameterStatement.cpp
-#ifdef __GNUC__
-using std::isnan;
-#endif
-
template <class FP> bool
better_equal(FP a, FP b)
{
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits