[gjs] Conditionally adapt to JS_CLASS_TRACE removal



commit 0f886dc29b268ad0683e1372a80044a40a981192
Author: Marc-Antoine Perennou <Marc-Antoine Perennou com>
Date:   Fri Apr 1 20:55:43 2011 +0200

    Conditionally adapt to JS_CLASS_TRACE removal
    
    Upstream removed it in http://hg.mozilla.org/mozilla-central/rev/a7784d11c59b
    
    https://bugzilla.gnome.org/show_bug.cgi?id=646471

 configure.ac    |    3 +++
 gi/keep-alive.c |   10 ++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index d185ba1..1c773c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -155,11 +155,14 @@ else
   AC_MSG_ERROR([$JS_PACKAGE >= 1.9.2 is required])
 fi
 
+dnl xulrunner 2 checks
 AC_CHECK_LIB([mozjs], [JS_GetStringBytes], AC_DEFINE([HAVE_JS_GETSTRINGBYTES], [1], [Define if we still have JS_GetStringBytes]),, [$JS_LIBS])
 AC_CHECK_LIB([mozjs], [JS_GetFunctionName], AC_DEFINE([HAVE_JS_GETFUNCTIONNAME], [1], [Define if we still have JS_GetFunctionName]),, [$JS_LIBS])
 AC_CHECK_LIB([mozjs], [JS_GetStringChars], AC_DEFINE([HAVE_JS_GETSTRINGCHARS], [1], [Define if we still have JS_GetStringChars]),, [$JS_LIBS])
 AC_CHECK_LIB([mozjs], [JS_StrictPropertyStub], AC_DEFINE([HAVE_JS_STRICTPROPERTYSTUB], [1], [Define if we have JS_StrictPropertyStub]),, [$JS_LIBS])
 AC_CHECK_LIB([mozjs], [JS_GetGlobalForScopeChain], AC_DEFINE([HAVE_JS_GETGLOBALFORSCOPECHAIN], [1], [Define if we have JS_GetGlobalForScopeChain]),, [$JS_LIBS])
+dnl xulrunner 2.2 checks
+AC_CHECK_LIB([mozjs], [JS_CLASS_TRACE], AC_DEFINE([HAVE_JS_CLASS_TRACE], [1], [Define if we still have JS_CLASS_TRACE]),, [$JS_LIBS])
 
 AC_MSG_CHECKING([for mozilla-js >= 2 ])
 if `$PKG_CONFIG --exists $JS_PACKAGE '>=' 2`; then
diff --git a/gi/keep-alive.c b/gi/keep-alive.c
index c7149ac..e268eaf 100644
--- a/gi/keep-alive.c
+++ b/gi/keep-alive.c
@@ -184,8 +184,10 @@ keep_alive_trace(JSTracer *tracer,
  */
 static struct JSClass gjs_keep_alive_class = {
     "__private_GjsKeepAlive", /* means "new __private_GjsKeepAlive()" works */
-    JSCLASS_HAS_PRIVATE |
-    JSCLASS_MARK_IS_TRACE, /* TraceOp not MarkOp */
+#ifdef HAVE_JS_CLASS_TRACE
+    JSCLASS_MARK_IS_TRACE | /* TraceOp not MarkOp */
+#endif
+    JSCLASS_HAS_PRIVATE,
     JS_PropertyStub,
     JS_PropertyStub,
     JS_PropertyStub,
@@ -200,7 +202,11 @@ static struct JSClass gjs_keep_alive_class = {
     NULL,
     NULL,
     NULL,
+#ifdef HAVE_JS_CLASS_TRACE
     JS_CLASS_TRACE(keep_alive_trace),
+#else
+    keep_alive_trace,
+#endif
     NULL
 };
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]