71a7a32ef7
for solved libtool issue and add fix for tests on big-endian arches looks good to espie@ requested, bulk-tested and ok by bernd@
43 lines
1.3 KiB
Plaintext
43 lines
1.3 KiB
Plaintext
$OpenBSD: patch-src_util_c,v 1.3 2009/01/31 15:49:34 simon Exp $
|
|
--- src/util.c.orig Thu Jan 15 15:01:47 2009
|
|
+++ src/util.c Tue Jan 27 10:22:58 2009
|
|
@@ -19,6 +19,7 @@
|
|
#include "sqliteInt.h"
|
|
#include <stdarg.h>
|
|
#include <ctype.h>
|
|
+#include <math.h>
|
|
|
|
|
|
/*
|
|
@@ -56,29 +57,7 @@ int sqlite3Assert(void){
|
|
** Return true if the floating point value is Not a Number (NaN).
|
|
*/
|
|
int sqlite3IsNaN(double x){
|
|
- /* This NaN test sometimes fails if compiled on GCC with -ffast-math.
|
|
- ** On the other hand, the use of -ffast-math comes with the following
|
|
- ** warning:
|
|
- **
|
|
- ** This option [-ffast-math] should never be turned on by any
|
|
- ** -O option since it can result in incorrect output for programs
|
|
- ** which depend on an exact implementation of IEEE or ISO
|
|
- ** rules/specifications for math functions.
|
|
- **
|
|
- ** Under MSVC, this NaN test may fail if compiled with a floating-
|
|
- ** point precision mode other than /fp:precise. From the MSDN
|
|
- ** documentation:
|
|
- **
|
|
- ** The compiler [with /fp:precise] will properly handle comparisons
|
|
- ** involving NaN. For example, x != x evaluates to true if x is NaN
|
|
- ** ...
|
|
- */
|
|
-#ifdef __FAST_MATH__
|
|
-# error SQLite will not work correctly with the -ffast-math option of GCC.
|
|
-#endif
|
|
- volatile double y = x;
|
|
- volatile double z = y;
|
|
- return y!=z;
|
|
+ return isnan(x);
|
|
}
|
|
|
|
/*
|