From 8fba230594475cfe2f19d3ad349fed6d6c8dab6a Mon Sep 17 00:00:00 2001 From: Jens Ayton Date: Mon, 24 Jan 2011 19:39:45 +0000 Subject: [PATCH] Ensure consistent definition of OO_NEW_JS. git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4145 127b21dd-08f5-0310-b4b7-95ae10353056 --- src/Core/Debug/OODebugMonitor.m | 10 +++++++++- src/Core/Scripting/OOJSPropID.h | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Core/Debug/OODebugMonitor.m b/src/Core/Debug/OODebugMonitor.m index 1a1faff0..3c46ae24 100644 --- a/src/Core/Debug/OODebugMonitor.m +++ b/src/Core/Debug/OODebugMonitor.m @@ -202,7 +202,15 @@ static OODebugMonitor *sSingleton = nil; - (oneway void)performJSConsoleCommand:(in NSString *)command { OOJSStartTimeLimiterWithTimeLimit(kOOJSLongTimeLimit); - [_script doEvent:OOJSID("consolePerformJSCommand") withArguments:[NSArray arrayWithObject:command]]; + + int x = __builtin_choose_expr(__builtin_types_compatible_p(OOJSPropID, const char *), 0, ""); + + static jsid idCache; + static BOOL inited; + if (EXPECT_NOT(!inited)) OOJSInitPropIDCachePRIVATE("consolePerformJSCommand", &idCache, &inited); + OOJSPropID propID = idCache; + [_script doEvent:propID withArguments:[NSArray arrayWithObject:command]]; + OOJSStopTimeLimiter(); } diff --git a/src/Core/Scripting/OOJSPropID.h b/src/Core/Scripting/OOJSPropID.h index ca8d94c8..bf00e853 100644 --- a/src/Core/Scripting/OOJSPropID.h +++ b/src/Core/Scripting/OOJSPropID.h @@ -8,6 +8,11 @@ #import +#ifndef OO_NEW_JS +#define OO_NEW_JS 0 +#endif + + #if OO_NEW_JS typedef jsid OOJSPropID; #else