Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit bd949603 authored by rswindell's avatar rswindell

Eliminated jsval_isNaN(), using JSDOUBLE_IS_NaN() macro in JSVAL_IS_NUM()

instead (suggestion by b.e.).
parent 6f5398a9
......@@ -39,10 +39,6 @@
#include "ident.h"
#include "telnet.h"
#ifdef JAVASCRIPT
#include <jsnum.h> /* JSDOUBLE_IS_NaN() */
#endif
#ifdef __unix__
#include <sys/un.h>
#ifndef SUN_LEN
......@@ -282,20 +278,6 @@ DLLEXPORT int DLLCALL sbbs_random(int n)
static js_server_props_t js_server_props;
JSBool
DLLCALL jsval_isNaN(JSContext *cx, jsval v)
{
jsdouble d;
if(JSVAL_IS_DOUBLE(v)) {
if(!JS_ValueToNumber(cx, v, &d))
return JS_FALSE;
if(JSDOUBLE_IS_NaN(d))
return JS_TRUE;
}
return JS_FALSE;
}
JSBool
DLLCALL js_CreateArrayOfStrings(JSContext* cx, JSObject* parent, const char* name, char* str[],uintN flags)
{
......
......@@ -99,6 +99,8 @@
#define JS_THREADSAFE /* Required! */
#include <jsapi.h>
#include <jsprf.h> /* JS-safe sprintf functions */
#include <jsnum.h> /* JSDOUBLE_IS_NaN() */
#endif
/***********************/
......@@ -949,9 +951,8 @@ extern "C" {
DLLEXPORT JSBool DLLCALL js_DefineConstIntegers(JSContext* cx, JSObject* obj, jsConstIntSpec*, int flags);
DLLEXPORT JSBool DLLCALL js_CreateArrayOfStrings(JSContext* cx, JSObject* parent
,const char* name, char* str[], uintN flags);
DLLEXPORT JSBool DLLCALL jsval_isNaN(JSContext* cx, jsval);
#define JSVAL_IS_NUM(cx,v) (JSVAL_IS_NUMBER(v) && !jsval_isNaN(cx,v))
#define JSVAL_IS_NUM(v) (JSVAL_IS_NUMBER(v) && (!JSVAL_IS_DOUBLE(v) || !JSDOUBLE_IS_NaN(*JSVAL_TO_DOUBLE(v))))
/* js_server.c */
DLLEXPORT JSObject* DLLCALL js_CreateServerObject(JSContext* cx, JSObject* parent
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment