summaryrefslogtreecommitdiffstats
path: root/src/dom/js/jsnum.h
diff options
context:
space:
mode:
authorBob Jamison <ishmalius@gmail.com>2007-03-05 10:34:59 +0000
committerishmal <ishmal@users.sourceforge.net>2007-03-05 10:34:59 +0000
commit33837efd4b94c4ebb80f95b3d9dbb6efd5499a98 (patch)
treede482d7687b3bffa97cc78608ba75a8ad7e52b60 /src/dom/js/jsnum.h
parentAdding optional dialog preview. Implments RFE [ 1435276 ] switch preview on/o... (diff)
downloadinkscape-33837efd4b94c4ebb80f95b3d9dbb6efd5499a98.tar.gz
inkscape-33837efd4b94c4ebb80f95b3d9dbb6efd5499a98.zip
update JS
(bzr r2555)
Diffstat (limited to 'src/dom/js/jsnum.h')
-rw-r--r--src/dom/js/jsnum.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/dom/js/jsnum.h b/src/dom/js/jsnum.h
index 28f40e6ec..cd99501e7 100644
--- a/src/dom/js/jsnum.h
+++ b/src/dom/js/jsnum.h
@@ -67,9 +67,9 @@ JS_BEGIN_EXTERN_C
typedef union jsdpun {
struct {
#if defined(IS_LITTLE_ENDIAN) && !defined(CPU_IS_ARM)
- uint32 lo, hi;
+ uint32 lo, hi;
#else
- uint32 hi, lo;
+ uint32 hi, lo;
#endif
} s;
jsdouble d;
@@ -124,7 +124,7 @@ typedef union jsdpun {
((JSDOUBLE_HI32(x) & JSDOUBLE_HI32_EXPMASK) != JSDOUBLE_HI32_EXPMASK)
#define JSDOUBLE_IS_NEGZERO(d) (JSDOUBLE_HI32(d) == JSDOUBLE_HI32_SIGNBIT && \
- JSDOUBLE_LO32(d) == 0)
+ JSDOUBLE_LO32(d) == 0)
/*
* JSDOUBLE_IS_INT first checks that d is neither NaN nor infinite, to avoid
@@ -134,7 +134,16 @@ typedef union jsdpun {
*/
#define JSDOUBLE_IS_INT(d, i) (JSDOUBLE_IS_FINITE(d) \
&& !JSDOUBLE_IS_NEGZERO(d) \
- && ((d) == (i = (jsint)(d))))
+ && ((d) == (i = (jsint)(d))))
+
+#if defined(XP_WIN)
+#define JSDOUBLE_COMPARE(LVAL, OP, RVAL, IFNAN) \
+ ((JSDOUBLE_IS_NaN(LVAL) || JSDOUBLE_IS_NaN(RVAL)) \
+ ? (IFNAN) \
+ : (LVAL) OP (RVAL))
+#else
+#define JSDOUBLE_COMPARE(LVAL, OP, RVAL, IFNAN) ((LVAL) OP (RVAL))
+#endif
/* Initialize number constants and runtime state for the first context. */
extern JSBool
@@ -144,6 +153,8 @@ extern void
js_FinishRuntimeNumberState(JSContext *cx);
/* Initialize the Number class, returning its prototype object. */
+extern JSClass js_NumberClass;
+
extern JSObject *
js_InitNumberClass(JSContext *cx, JSObject *obj);
@@ -159,7 +170,7 @@ extern const char js_parseInt_str[];
/* GC-allocate a new JS number. */
extern jsdouble *
-js_NewDouble(JSContext *cx, jsdouble d);
+js_NewDouble(JSContext *cx, jsdouble d, uintN gcflag);
extern void
js_FinalizeDouble(JSContext *cx, jsdouble *dp);