diff options
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. ** |