Module Name:    src
Committed By:   martin
Date:           Thu Oct 13 18:11:20 UTC 2016

Modified Files:
        src/external/public-domain/sqlite: Makefile.inc
        src/external/public-domain/sqlite/dist: sqlite3.c

Log Message:
PR lib/51533: make big endian arm support work again, patch from
Rin Okuyama.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/public-domain/sqlite/Makefile.inc
cvs rdiff -u -r1.14 -r1.15 src/external/public-domain/sqlite/dist/sqlite3.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/public-domain/sqlite/Makefile.inc
diff -u src/external/public-domain/sqlite/Makefile.inc:1.6 src/external/public-domain/sqlite/Makefile.inc:1.7
--- src/external/public-domain/sqlite/Makefile.inc:1.6	Sun Jul  3 10:27:00 2016
+++ src/external/public-domain/sqlite/Makefile.inc	Thu Oct 13 18:11:19 2016
@@ -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 @@ CPPFLAGS+=	\
 		-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 \

Index: src/external/public-domain/sqlite/dist/sqlite3.c
diff -u src/external/public-domain/sqlite/dist/sqlite3.c:1.14 src/external/public-domain/sqlite/dist/sqlite3.c:1.15
--- src/external/public-domain/sqlite/dist/sqlite3.c:1.14	Mon Jul  4 03:04:25 2016
+++ src/external/public-domain/sqlite/dist/sqlite3.c	Thu Oct 13 18:11:19 2016
@@ -11567,23 +11567,31 @@ typedef INT16_TYPE LogEst;
 ** -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)
+#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

Reply via email to