Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/public-domain/sqlite PR lib/51533: make big endian ...
details: https://anonhg.NetBSD.org/src/rev/4de83025052b
branches: trunk
changeset: 348287:4de83025052b
user: martin <martin%NetBSD.org@localhost>
date: Thu Oct 13 18:11:19 2016 +0000
description:
PR lib/51533: make big endian arm support work again, patch from
Rin Okuyama.
diffstat:
external/public-domain/sqlite/Makefile.inc | 3 +-
external/public-domain/sqlite/dist/sqlite3.c | 30 +++++++++++++++++----------
2 files changed, 21 insertions(+), 12 deletions(-)
diffs (63 lines):
diff -r 0946690d772b -r 4de83025052b external/public-domain/sqlite/Makefile.inc
--- a/external/public-domain/sqlite/Makefile.inc Thu Oct 13 17:11:09 2016 +0000
+++ b/external/public-domain/sqlite/Makefile.inc Thu Oct 13 18:11:19 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.6 2016/07/03 10:27:00 abhinav Exp $
+# $NetBSD: Makefile.inc,v 1.7 2016/10/13 18:11:19 martin Exp $
WARNS= 2
@@ -14,6 +14,7 @@
-DHAVE_STDINT_H=1 \
-DHAVE_STRERROR_R=1 \
-DHAVE_USLEEP=1 \
+ -DHAVE_SYS_ENDIAN_H=1 \
-DSQLITE_ENABLE_COLUMN_METADATA \
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
-DSQLITE_ENABLE_FTS4 \
diff -r 0946690d772b -r 4de83025052b external/public-domain/sqlite/dist/sqlite3.c
--- a/external/public-domain/sqlite/dist/sqlite3.c Thu Oct 13 17:11:09 2016 +0000
+++ b/external/public-domain/sqlite/dist/sqlite3.c Thu Oct 13 18:11:19 2016 +0000
@@ -11567,23 +11567,31 @@
** -DSQLITE_RUNTIME_BYTEORDER=1 is set, then byte-order is determined
** at run-time.
*/
-#if (defined(i386) || defined(__i386__) || defined(_M_IX86) || \
+#if defined(HAVE_SYS_ENDIAN_H) && !defined(SQLITE_RUNTIME_BYTEORDER)
+# include <sys/endian.h>
+# define SQLITE_BYTEORDER _BYTE_ORDER
+#elif (defined(i386) || defined(__i386__) || defined(_M_IX86) || \
defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \
defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \
defined(__arm__)) && !defined(SQLITE_RUNTIME_BYTEORDER)
# define SQLITE_BYTEORDER 1234
-# define SQLITE_BIGENDIAN 0
-# define SQLITE_LITTLEENDIAN 1
-# define SQLITE_UTF16NATIVE SQLITE_UTF16LE
-#endif
-#if (defined(sparc) || defined(__ppc__)) \
+#elif (defined(sparc) || defined(__ppc__)) \
&& !defined(SQLITE_RUNTIME_BYTEORDER)
# define SQLITE_BYTEORDER 4321
-# define SQLITE_BIGENDIAN 1
-# define SQLITE_LITTLEENDIAN 0
-# define SQLITE_UTF16NATIVE SQLITE_UTF16BE
-#endif
-#if !defined(SQLITE_BYTEORDER)
+#endif
+#ifdef SQLITE_BYTEORDER
+# if SQLITE_BYTEORDER == 1234
+# define SQLITE_BIGENDIAN 0
+# define SQLITE_LITTLEENDIAN 1
+# define SQLITE_UTF16NATIVE SQLITE_UTF16LE
+# elif SQLITE_BYTEORDER == 4321
+# define SQLITE_BIGENDIAN 1
+# define SQLITE_LITTLEENDIAN 0
+# define SQLITE_UTF16NATIVE SQLITE_UTF16BE
+# else
+# error "Unknown byte order."
+# endif
+#else
# ifdef SQLITE_AMALGAMATION
const int sqlite3one = 1;
# else
Home |
Main Index |
Thread Index |
Old Index