mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-28 17:13:12 +00:00
Fix ABI incompatibility with --with-system-mozjs185 in debug mode (see #990).
This was SVN commit r10535.
This commit is contained in:
@@ -1099,7 +1099,7 @@ void* ScriptInterface::GetPrivate(JSContext* cx, JSObject* obj)
|
||||
|
||||
void ScriptInterface::DumpHeap()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if MOZJS_DEBUG_ABI
|
||||
JS_DumpHeap(m->m_cx, stderr, NULL, 0, NULL, (size_t)-1, NULL);
|
||||
#endif
|
||||
fprintf(stderr, "# Bytes allocated: %d\n", JS_GetGCParameter(GetRuntime(), JSGC_BYTES));
|
||||
|
||||
@@ -33,11 +33,31 @@
|
||||
// the ones that are needed and this avoids conflicting definitions
|
||||
# define JS_SYS_TYPES_H_DEFINES_EXACT_SIZE_TYPES
|
||||
|
||||
#else
|
||||
#else // If not Windows, then Unix:
|
||||
|
||||
# define XP_UNIX
|
||||
|
||||
// In DEBUG mode, jsval defaults to struct types. Normally we build separate
|
||||
// debug/release mode versions of the library, but when using --with-system-mozjs185
|
||||
// it's always a release mode library, so we have to disable struct types for
|
||||
// ABI compatibility
|
||||
# if defined(DEBUG) && defined(WITH_SYSTEM_MOZJS185)
|
||||
# define JS_NO_JSVAL_JSID_STRUCT_TYPES
|
||||
# endif
|
||||
|
||||
#endif
|
||||
// (we don't support XP_OS2 or XP_BEOS)
|
||||
|
||||
|
||||
// Guess whether the library was compiled with the release-mode or debug-mode ABI
|
||||
// (for JS_DumpHeap etc)
|
||||
#if defined(DEBUG) && !defined(WITH_SYSTEM_MOZJS185)
|
||||
# define MOZJS_DEBUG_ABI 1
|
||||
#else
|
||||
# define MOZJS_DEBUG_ABI 0
|
||||
#endif
|
||||
|
||||
|
||||
#include <cstring> // required by jsutil.h
|
||||
|
||||
// SpiderMonkey wants the DEBUG flag
|
||||
|
||||
Reference in New Issue
Block a user