diff options
author | drh <> | 2024-10-01 16:55:30 +0000 |
---|---|---|
committer | drh <> | 2024-10-01 16:55:30 +0000 |
commit | dac22f656646db9b9429d13c7fcd0a20d6b8a9d6 (patch) | |
tree | 9bc2db4d724028df0fe495426dd576a1ce5ec51b /src/sqliteInt.h | |
parent | ed94e0e6778ca00db96690fe93820436cf2676d2 (diff) | |
download | sqlite-dac22f656646db9b9429d13c7fcd0a20d6b8a9d6.tar.gz sqlite-dac22f656646db9b9429d13c7fcd0a20d6b8a9d6.zip |
Add compile-time option -DSQLITE_USE_LONG_DOUBLE=0 to omit all attempts to use
"long double". Or =1 to omit attempts to use the Dekker algorithms to achieve
high-resolution floating point.
FossilOrigin-Name: ca5964ef70efad3332e0bf9c158eb5fd5006d3022051d1ac506c097c427735a1
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r-- | src/sqliteInt.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 604f7e975..5b166d9a3 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -4249,6 +4249,41 @@ typedef struct { # define Tuning(X) 0 #endif +/* By default, SQLite will use long double if the long double type +** actually provides higher resolution than double. This use or non-use +** of long double is switchable at run-time by a test-control. Dekker +** algorithms are used for high-precision floating point when long double +** is not available. +** +** Having the run-time option to enable/disable long double support +** causes problems for some compiler tool chains. So the following +** compile-time option is available to permanently enable/disable the use +** of long double. +** +** -DSQLITE_USE_LONG_DOUBLE=0 Omit all use of "long double" from +** the code. Instead, the Dekker algorithm +** is always used when high-precision +** floating point is required. +** +** -DSQLITE_USE_LONG_DOUBLE=1 Always use long double when high +** precision is needed. Never fall back +** to using Dekker algorithms. +** +** If the SQLITE_USE_LONG_DOUBLE macro is not defined, then the determination +** of whether or not to use long double is made at run-time. +*/ +#ifndef SQLITE_USE_LONG_DOUBLE +# define SqliteUseLongDouble sqlite3Config.bUseLongDouble +#elif SQLITE_USE_LONG_DOUBLE+0==1 +# define SqliteUseLongDouble 1 +#elif SQLITE_USE_LONG_DOUBLE+0==0 +# undef LONGDOUBLE_TYPE +# define LONGDOUBLE_TYPE double +# define SqliteUseLongDouble 0 +#else +# error "SQLITE_USE_LONG_DOUBLE should be set to either 0 or 1" +#endif + /* ** Structure containing global configuration data for the SQLite library. ** |