1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Add the SQLITE_TESTCTRL_BYTEORDER test control to interrogate SQLite's notion

of the processor byte order and whether the byte order is known at compile-time
or determined at run-time.

FossilOrigin-Name: 9c6961967ae00e563ebe2859eaf2639a79f2cb01
This commit is contained in:
drh
2014-04-18 00:06:02 +00:00
parent 65b9ac5224
commit 2cf4acbd9f
6 changed files with 38 additions and 16 deletions

View File

@@ -3205,6 +3205,22 @@ int sqlite3_test_control(int op, ...){
break;
}
/*
** sqlite3_test_control(SQLITE_TESTCTRL_BYTEORDER);
**
** The integer returned reveals the byte-order of the computer on which
** SQLite is running:
**
** 1 big-endian, determined at run-time
** 10 little-endian, determined at run-time
** 432101 big-endian, determined at compile-time
** 123410 little-endian, determined at compile-time
*/
case SQLITE_TESTCTRL_BYTEORDER: {
rc = SQLITE_BYTEORDER*100 + SQLITE_LITTLEENDIAN*10 + SQLITE_BIGENDIAN;
break;
}
/* sqlite3_test_control(SQLITE_TESTCTRL_RESERVE, sqlite3 *db, int N)
**
** Set the nReserve size to N for the main database on the database