1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

New #ifdefs to omit code that is unused when SQLITE_USE_LONG DOUBLE is defined.

FossilOrigin-Name: 98066e2d226e7d2eceec1931a1432baea956f49bf3c708d8a6d511fa4e864ca3
This commit is contained in:
drh
2024-10-01 19:10:47 +00:00
parent 1f2faa647f
commit 7151010919
5 changed files with 28 additions and 14 deletions

View File

@ -2277,6 +2277,7 @@ int main(int argc, char **argv){
int iCur, iHi; /* Stats values, current and "highwater" */
int i; /* Loop counter */
int rc; /* API return code */
int useLongDouble = -1; /* True to set use of long-double */
#ifdef SQLITE_SPEEDTEST1_WASM
/* Resetting all state is important for the WASM build, which may
@ -2334,6 +2335,8 @@ int main(int argc, char **argv){
}else if( strcmp(z,"key")==0 ){
ARGC_VALUE_CHECK(1);
zKey = argv[++i];
}else if( strcmp(z,"longdouble")==0 ){
useLongDouble = 1;
}else if( strcmp(z,"lookaside")==0 ){
ARGC_VALUE_CHECK(2);
nLook = integerValue(argv[i+1]);
@ -2353,9 +2356,7 @@ int main(int argc, char **argv){
mmapSize = integerValue(argv[++i]);
#endif
}else if( strcmp(z,"nolongdouble")==0 ){
#ifdef SQLITE_TESTCTRL_USELONGDOUBLE
sqlite3_test_control(SQLITE_TESTCTRL_USELONGDOUBLE, 0);
#endif
useLongDouble = 0;
}else if( strcmp(z,"nomutex")==0 ){
openFlags |= SQLITE_OPEN_NOMUTEX;
}else if( strcmp(z,"nosync")==0 ){
@ -2528,6 +2529,11 @@ int main(int argc, char **argv){
if( rc ) fatal_error("lookaside configuration failed: %d\n", rc);
}
#endif
#ifdef SQLITE_TESTCTRL_USELONGDOUBLE
if( useLongDouble>=0 ){
sqlite3_test_control(SQLITE_TESTCTRL_USELONGDOUBLE, useLongDouble);
}
#endif
if( g.nReserve>0 ){
sqlite3_file_control(g.db, 0, SQLITE_FCNTL_RESERVE_BYTES, &g.nReserve);
}