1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Add option 2 to SQLITE_TESTCTRL_USELONGDOUBLE to move the setting to its

defaults.  Enhance the CLI and testfixture to make use of this value.
Base the default on sizeof(LONGDOUBLE_TYPE) rather than on sizeof(long double).

FossilOrigin-Name: 64e6bd1c25d8e1dbfe511cba1921ff052c0fa4fe410fc9ce4435700a70cb88b1
This commit is contained in:
drh
2023-07-07 12:08:22 +00:00
parent 7d0103bb06
commit bae91082dd
6 changed files with 37 additions and 20 deletions

View File

@@ -4472,11 +4472,14 @@ int sqlite3_test_control(int op, ...){
/* sqlite3_test_control(SQLITE_TESTCTRL_USELONGDOUBLE, int X);
**
** Enable long double usage if X>0. Disable if X==0. No-op if X<0.
** Return the status of long double usage afterwards.
** X<0 Make no changes to the bUseLongDouble. Just report value.
** X==0 Disable bUseLongDouble
** X==1 Enable bUseLongDouble
** X==2 Set bUseLongDouble to its default value for this platform
*/
case SQLITE_TESTCTRL_USELONGDOUBLE: {
int b = va_arg(ap, int);
if( b==2 ) b = sizeof(LONGDOUBLE_TYPE)>8;
if( b>=0 ) sqlite3Config.bUseLongDouble = b>0;
rc = sqlite3Config.bUseLongDouble!=0;
break;