1
0
forked from 0ad/0ad

all JS-dependent code now includes scripting/SpiderMonkey.h instead of <js*.h> directly - see rationale in that header.

singleton: removed unnecessary headers

This was SVN commit r2425.
This commit is contained in:
janwas 2005-06-22 02:23:46 +00:00
parent 92e50f2992
commit f3951fbfae
6 changed files with 40 additions and 27 deletions

View File

@ -3,15 +3,7 @@
#include "ScriptInterface.h"
#include "CLocale.h"
#include "StringConvert.h"
#include <jsapi.h>
// Make JS debugging a little easier by automatically naming GC roots
#ifndef NDEBUG
// Don't simply #define NAME_ALL_GC_ROOTS, because jsapi.h is horridly broken
# define JS_AddRoot(cx, rp) JS_AddNamedRoot((cx), (rp), __FILE__)
#endif
#include "scripting/SpiderMonkey.h"
#include "ps/CLogger.h"
#define LOG_CATEGORY "i18n"

View File

@ -19,10 +19,6 @@
#ifndef _TEMPLATE_SINGLETON
#define _TEMPLATE_SINGLETON
#include <assert.h>
#include "lib.h"
template<typename T>
class Singleton
{
@ -31,7 +27,7 @@ class Singleton
public:
Singleton()
{
assert( !ms_singleton );
assert2( !ms_singleton );
//use a cunning trick to get the singleton pointing to the start of
//the whole, rather than the start of the Singleton part of the object

View File

@ -5,7 +5,7 @@
#include <assert.h>
#include <jsapi.h>
#include "scripting/SpiderMonkey.h"
#if SDL_BYTE_ORDER == SDL_BIG_ENDIAN
#define ucs2le_to_wchart(ptr) (wchar_t)( (u16) ((u8*)ptr)[0] | (u16) ( ((u8*)ptr)[1] << 8) )

View File

@ -6,7 +6,7 @@
#include "scripting/ScriptingHost.h"
#include "JSConversions.h"
#include <jsatom.h>
#include "scripting/SpiderMonkey.h"
#include <set>

View File

@ -26,17 +26,7 @@ ERROR_SUBGROUP(Scripting, DefineType);
ERROR_TYPE(Scripting_DefineType, AlreadyExists);
ERROR_TYPE(Scripting_DefineType, CreationFailed);
#include <jsapi.h>
#ifndef NDEBUG
#include <jsdbgapi.h>
#endif
// Make JS debugging a little easier by automatically naming GC roots
#ifndef NDEBUG
// Don't simply #define NAME_ALL_GC_ROOTS, because jsapi.h is horridly broken
# define JS_AddRoot(cx, rp) JS_AddNamedRoot((cx), (rp), __FILE__ )
#endif
#include "scripting/SpiderMonkey.h"
#include <string>
#include <vector>

View File

@ -0,0 +1,35 @@
// master header for the SpiderMonkey Javascript library.
// include this instead of accessing any <js*.h> headers directly.
// rationale: these headers require an OS macro to be set (XP_*).
// since this is specific to SpiderMonkey, we don't want to hide the fact in
// some obscure header that's pulled in via PCH (would make reuse harder).
// we take care of it below.
// 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 defined(OS_WIN)
# define XP_WIN
#elif defined(OS_MAC)
# define XP_MAC
#elif defined(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