summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-12 05:54:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:20:08 -0500
commit9570e24df1397f31dbd7c8436928749da9fc378c (patch)
treef8e0503ee1b0a8a7ff1e31061fe6c11fe3d88eb4
parent9f86e202865807ed898eff684d7cf3be7daae0fc (diff)
downloadsamba-9570e24df1397f31dbd7c8436928749da9fc378c.tar.gz
samba-9570e24df1397f31dbd7c8436928749da9fc378c.tar.bz2
samba-9570e24df1397f31dbd7c8436928749da9fc378c.zip
r8341: enable floating point support in ejs
(This used to be commit bdc6b67eb27cc3da6d5144bbb71096741f779aba)
-rw-r--r--source4/lib/ejs/config.h6
-rw-r--r--source4/lib/ejs/miniMpr.h1
-rw-r--r--source4/lib/ejs/var.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/source4/lib/ejs/config.h b/source4/lib/ejs/config.h
index e6cd603907..320318a0b2 100644
--- a/source4/lib/ejs/config.h
+++ b/source4/lib/ejs/config.h
@@ -45,7 +45,7 @@
#define BLD_FEATURE_EJS 1
#define BLD_FEATURE_ESP_MODULE 1
#define BLD_FEATURE_EVAL_PERIOD 30
-#define BLD_FEATURE_FLOATING_POINT 0
+#define BLD_FEATURE_FLOATING_POINT 1
#define BLD_FEATURE_IF_MODIFIED 0
#define BLD_FEATURE_INT64 1
#define BLD_FEATURE_KEEP_ALIVE 0
@@ -135,3 +135,7 @@
#define BLD_BIN_DIR "${BLD_TOP}/bin"
#define BLD_INC_DIR "/usr/include/${BLD_PRODUCT}"
#define BLD_EXP_OBJ_DIR "${BLD_TOP}/obj"
+
+#ifndef MAX_FLOAT
+#define MAX_FLOAT 3.40282347e+38F
+#endif
diff --git a/source4/lib/ejs/miniMpr.h b/source4/lib/ejs/miniMpr.h
index 3bbd63a302..d431ebdc1b 100644
--- a/source4/lib/ejs/miniMpr.h
+++ b/source4/lib/ejs/miniMpr.h
@@ -74,6 +74,7 @@
#if QNX4
#include <dirent.h>
#endif
+ #include <math.h>
/********************************** Defines ***********************************/
diff --git a/source4/lib/ejs/var.c b/source4/lib/ejs/var.c
index 843d2ff738..7cbf8a0b7f 100644
--- a/source4/lib/ejs/var.c
+++ b/source4/lib/ejs/var.c
@@ -1843,7 +1843,7 @@ bool mprVarToBool(const MprVar *vp)
* Convert the variable to a floating point number. Only for primitive types.
*/
-double mprVarToFloat(MprVar *vp)
+double mprVarToFloat(const MprVar *vp)
{
mprAssert(vp);