FreeWRL/FreeX3D  3.0.0
system_js.h
1 /*
2 
3 
4 FreeWRL support library.
5 Internal header: Javascript engine dependencies.
6 
7 */
8 
9 /****************************************************************************
10  This file is part of the FreeWRL/FreeX3D Distribution.
11 
12  Copyright 2009 CRC Canada. (http://www.crc.gc.ca)
13 
14  FreeWRL/FreeX3D is free software: you can redistribute it and/or modify
15  it under the terms of the GNU Lesser Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  FreeWRL/FreeX3D is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  GNU General Public License for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with FreeWRL/FreeX3D. If not, see <http://www.gnu.org/licenses/>.
26 ****************************************************************************/
27 
28 
29 #ifndef __LIBFREEWRL_SYSTEM_JS_H__
30 #define __LIBFREEWRL_SYSTEM_JS_H__
31 
32 
33 /*
34  spidermonkey is built with the following flags on Mac:
35 
36 -Wall -Wno-format -no-cpp-precomp -fno-common -DJS_THREADSAFE -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DDARWIN -UDEBUG -DNDEBUG -UDEBUG_root -DJS_THREADSAFE -DEDITLINE
37 
38 */
39 
40 #define JS_HAS_FILE_OBJECT 1 /* workaround warning=>error */
41 
42 #if defined(IPHONE) || defined(_ANDROID) || defined(NO_JAVASCRIPT)
43 typedef int JSContext;
44 typedef int JSObject;
45 typedef int JSScript;
46 typedef int jsval;
47 typedef int jsid;
48 typedef int JSType;
49 typedef int JSClass;
50 typedef int JSFunctionSpec;
51 typedef int JSPropertySpec;
52 typedef int JSBool;
53 typedef int uintN;
54 typedef int JSErrorReport;
55 
56 
57 
58 /* int jsrrunScript(JSContext *_context, JSObject *_globalObj, char *script, jsval *rval); */
59 #else
60 
61 
62 #ifdef MOZILLA_JS_UNSTABLE_INCLUDES
63 # include "../unstable/jsapi.h" /* JS compiler */
64 # include "../unstable/jsdbgapi.h" /* JS debugger */
65 #else
66 # include <jsapi.h> /* JS compiler */
67 # include <jsdbgapi.h> /* JS debugger */
68 #endif
69 
70 #if JS_VERSION >= 185
71 #define JSSCRIPT JSObject
72 #else
73 #define JSSCRIPT JSScript
74 #endif
75 
76 #define JS_GET_PROPERTY_STUB JS_PropertyStub
77 /* #define JS_GET_PROPERTY_STUB js_GetPropertyDebug */
78 
79 #define JS_SET_PROPERTY_STUB1 js_SetPropertyDebug1
80 
81 /* #define JS_SET_PROPERTY_STUB2 js_SetPropertyDebug2 */
82 #if JS_VERSION < 185
83 # define JS_SET_PROPERTY_STUB2 JS_PropertyStub
84 #else
85 # define JS_SET_PROPERTY_STUB2 JS_StrictPropertyStub
86 #endif
87 
88 #define JS_SET_PROPERTY_STUB3 js_SetPropertyDebug3
89 #define JS_SET_PROPERTY_STUB4 js_SetPropertyDebug4
90 #define JS_SET_PROPERTY_STUB5 js_SetPropertyDebug5
91 #define JS_SET_PROPERTY_STUB6 js_SetPropertyDebug6
92 #define JS_SET_PROPERTY_STUB7 js_SetPropertyDebug7
93 #define JS_SET_PROPERTY_STUB8 js_SetPropertyDebug8
94 #define JS_SET_PROPERTY_CHECK js_SetPropertyCheck
95 
96 
97 #endif /* IPHONE */
98 
99 #endif /* __LIBFREEWRL_SYSTEM_JS_H__ */