1
0
forked from 0ad/0ad
0ad/source/scripting/SpiderMonkey.h
janwas a69ac0dee9 - fix w4 warnings
- add convenience macros for config_db(CFG_GET_SYS_VAL)
- VFSUtil::EnumDirEnts now uses flags instead of bool recursive
- UNUSED() for params, UNUSED2 (<- need better name) for variables
- config.h defines must be tested with #if (always defined) -> allows
detecting misspellings thanks to compiler warnings
- replace debug_assert(0) with debug_warn (its sole purpose)
- replace ScriptingHost::ValueToInt et al with ToPrimitive
- use nommgr.h to disable both mmgr and VC debug heap

This was SVN commit r2585.
2005-08-09 15:55:44 +00:00

40 lines
1.2 KiB
C

// Master header for the SpiderMonkey Javascript library.
//
// Include this instead of accessing any <js*.h> headers directly.
// Rationale: they require an OS macro to be set (XP_*).
// Since this is specific to SpiderMonkey, we don't want to saddle
// another obscure header with it (would make reuse harder).
// Instead, do it here where the purpose is clear.
//
// This doesn't go in ScriptingHost.h because some other files
// (notably precompiled.h and i18n/ScriptInterface.cpp) want only these
// definitions without pulling in the whole of ScriptingHost.
// jstypes.h (included via jsapi.h) requires we define
// "one of XP_BEOS, XP_MAC, XP_OS2, XP_WIN or XP_UNIX".
#include "config.h"
#if OS_WIN
# define XP_WIN
#elif OS_MAC
# define XP_MAC
#elif OS_BEOS
# define XP_BEOS
#else
# define XP_UNIX
#endif
#include <jsapi.h>
#include <jsatom.h>
#ifndef NDEBUG
# include <jsdbgapi.h>
#endif
// include any further required headers here
// Make JS debugging a little easier by automatically naming GC roots
// Don't simply #define NAME_ALL_GC_ROOTS, because jsapi.h is horridly broken
#ifndef NDEBUG
# define JS_AddRoot(cx, rp) JS_AddNamedRoot((cx), (rp), __FILE__ )
#endif