diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/func.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/func.c b/src/func.c index e91fc256c..6cd9fdce6 100644 --- a/src/func.c +++ b/src/func.c @@ -1952,6 +1952,14 @@ static void ceilingFunc( } /* +** On some systems, ceil() and floor() are intrinsic function. You are +** unable to take a pointer to this functions. Hence, we here wrap them +** in our own actual functions. +*/ +static double xCeil(double x){ return ceil(x); } +static double xFloor(double x){ return floor(x); } + +/* ** Implementation of SQL functions: ** ** ln(X) - natural logarithm @@ -2211,9 +2219,9 @@ void sqlite3RegisterBuiltinFunctions(void){ FUNCTION(coalesce, 1, 0, 0, 0 ), FUNCTION(coalesce, 0, 0, 0, 0 ), #ifdef SQLITE_ENABLE_MATH_FUNCTIONS - MFUNCTION(ceil, 1, ceil, ceilingFunc ), - MFUNCTION(ceiling, 1, ceil, ceilingFunc ), - MFUNCTION(floor, 1, floor, ceilingFunc ), + MFUNCTION(ceil, 1, xCeil, ceilingFunc ), + MFUNCTION(ceiling, 1, xCeil, ceilingFunc ), + MFUNCTION(floor, 1, xFloor, ceilingFunc ), #if SQLITE_HAVE_C99_MATH_FUNCS MFUNCTION(trunc, 1, trunc, ceilingFunc ), #endif |