diff options
author | dan <Dan Kennedy> | 2024-10-02 11:11:29 +0000 |
---|---|---|
committer | dan <Dan Kennedy> | 2024-10-02 11:11:29 +0000 |
commit | 512ad53f3ac8ae97bf83021efd96f96e79750b57 (patch) | |
tree | 0ee9e2dd9df3f092d5e0015987e296300fcfb6e7 /src/main.c | |
parent | f9d1141a3b34e36cf26be87dbd199b036985b2d6 (diff) | |
parent | 7151010919cff7ab5134173f5d22fdf534104c34 (diff) | |
download | sqlite-512ad53f3ac8ae97bf83021efd96f96e79750b57.tar.gz sqlite-512ad53f3ac8ae97bf83021efd96f96e79750b57.zip |
Merge latest trunk changes into this branch.
FossilOrigin-Name: 2b3945e6a597e6853cac567052e92926c8cb6d7a029ac64c2d45c321bbe2e94d
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c index fceb7957b..bfbabcbec 100644 --- a/src/main.c +++ b/src/main.c @@ -159,6 +159,7 @@ char *sqlite3_temp_directory = 0; */ char *sqlite3_data_directory = 0; +#if !defined(SQLITE_OMIT_WSD) && !defined(SQLITE_USE_LONG_DOUBLE) /* ** Determine whether or not high-precision (long double) floating point ** math works correctly on CPU currently running. @@ -183,7 +184,7 @@ static SQLITE_NOINLINE int hasHighPrecisionDouble(int rc){ return b!=c; } } - +#endif /* !SQLITE_OMIT_WSD && !SQLITE_USE_LONG_DOUBLE */ /* ** Initialize SQLite. @@ -380,9 +381,7 @@ int sqlite3_initialize(void){ } #endif - /* Experimentally determine if high-precision floating point is - ** available. */ -#ifndef SQLITE_OMIT_WSD +#if !defined(SQLITE_OMIT_WSD) && !defined(SQLITE_USE_LONG_DOUBLE) sqlite3Config.bUseLongDouble = hasHighPrecisionDouble(rc); #endif @@ -4645,12 +4644,18 @@ int sqlite3_test_control(int op, ...){ ** X==0 Disable bUseLongDouble ** X==1 Enable bUseLongDouble ** X>=2 Set bUseLongDouble to its default value for this platform + ** + ** If the SQLITE_USE_LONG_DOUBLE compile-time option has been used, then + ** the bUseLongDouble setting is fixed. This test-control becomes a + ** no-op, except that it still reports the fixed setting. */ case SQLITE_TESTCTRL_USELONGDOUBLE: { +#if !defined(SQLITE_USE_LONG_DOUBLE) int b = va_arg(ap, int); if( b>=2 ) b = hasHighPrecisionDouble(b); if( b>=0 ) sqlite3Config.bUseLongDouble = b>0; - rc = sqlite3Config.bUseLongDouble!=0; +#endif + rc = SqliteUseLongDouble!=0; break; } #endif |