Fix ABI incompatibility with --with-system-mozjs185 in debug mode (see #990).
This was SVN commit r10535.
This commit is contained in:
parent
ed5a64aae4
commit
5bd7b74ec7
@ -472,6 +472,7 @@ extern_lib_defs = {
|
|||||||
compile_settings = function()
|
compile_settings = function()
|
||||||
if _OPTIONS["with-system-mozjs185"] then
|
if _OPTIONS["with-system-mozjs185"] then
|
||||||
pkgconfig_cflags("mozjs185")
|
pkgconfig_cflags("mozjs185")
|
||||||
|
defines { "WITH_SYSTEM_MOZJS185" }
|
||||||
else
|
else
|
||||||
if os.is("windows") then
|
if os.is("windows") then
|
||||||
include_dir = "include-win32"
|
include_dir = "include-win32"
|
||||||
|
@ -274,7 +274,7 @@ JSBool GetBuildTimestamp(JSContext* cx, uintN argc, jsval* vp)
|
|||||||
return JS_TRUE;
|
return JS_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#if MOZJS_DEBUG_ABI
|
||||||
void DumpHeap(const char* basename, int idx, JSContext* cx)
|
void DumpHeap(const char* basename, int idx, JSContext* cx)
|
||||||
{
|
{
|
||||||
char filename[64];
|
char filename[64];
|
||||||
@ -292,7 +292,7 @@ JSBool DumpHeaps(JSContext* cx, uintN argc, jsval* vp)
|
|||||||
UNUSED2(cx);
|
UNUSED2(cx);
|
||||||
UNUSED2(argc);
|
UNUSED2(argc);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#if MOZJS_DEBUG_ABI
|
||||||
static int i = 0;
|
static int i = 0;
|
||||||
|
|
||||||
if (ScriptingHost::IsInitialised())
|
if (ScriptingHost::IsInitialised())
|
||||||
|
@ -1099,7 +1099,7 @@ void* ScriptInterface::GetPrivate(JSContext* cx, JSObject* obj)
|
|||||||
|
|
||||||
void ScriptInterface::DumpHeap()
|
void ScriptInterface::DumpHeap()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#if MOZJS_DEBUG_ABI
|
||||||
JS_DumpHeap(m->m_cx, stderr, NULL, 0, NULL, (size_t)-1, NULL);
|
JS_DumpHeap(m->m_cx, stderr, NULL, 0, NULL, (size_t)-1, NULL);
|
||||||
#endif
|
#endif
|
||||||
fprintf(stderr, "# Bytes allocated: %d\n", JS_GetGCParameter(GetRuntime(), JSGC_BYTES));
|
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
|
// the ones that are needed and this avoids conflicting definitions
|
||||||
# define JS_SYS_TYPES_H_DEFINES_EXACT_SIZE_TYPES
|
# define JS_SYS_TYPES_H_DEFINES_EXACT_SIZE_TYPES
|
||||||
|
|
||||||
#else
|
#else // If not Windows, then Unix:
|
||||||
|
|
||||||
# define XP_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
|
#endif
|
||||||
// (we don't support XP_OS2 or XP_BEOS)
|
// (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
|
#include <cstring> // required by jsutil.h
|
||||||
|
|
||||||
// SpiderMonkey wants the DEBUG flag
|
// SpiderMonkey wants the DEBUG flag
|
||||||
|
@ -28,7 +28,14 @@
|
|||||||
# define JS_NO_JSVAL_JSID_STRUCT_TYPES
|
# define JS_NO_JSVAL_JSID_STRUCT_TYPES
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
# define XP_UNIX
|
# define XP_UNIX
|
||||||
|
|
||||||
|
// (See comment in scriptinterface/ScriptTypes.h)
|
||||||
|
# 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)
|
#endif // (we don't support XP_OS2 or XP_BEOS)
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
Loading…
Reference in New Issue
Block a user