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
This commit is contained in:
drh
2024-10-01 16:55:30 +00:00
parent ed94e0e677
commit dac22f6566
6 changed files with 59 additions and 19 deletions
+35
View File
@@ -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.
**