[gjs] jsapi: Use same #defines as SpiderMonkey



commit dd2a0c53febc75365bd468ec7ad125787f907010
Author: Philip Chimento <philip endlessm com>
Date:   Thu Nov 10 13:18:53 2016 -0800

    jsapi: Use same #defines as SpiderMonkey
    
    This pulls in js-config.h into jsapi-wrapper.h, because some of
    SpiderMonkey's #defines that are set at build time affect the public API.
    
    In addition, in mozjs24 and 31 at least, it looks like sometimes
    SpiderMonkey headers erroneously check for the presence of DEBUG instead
    of JS_DEBUG, so we should define DEBUG when JS_DEBUG is defined.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=742249

 gjs/jsapi-wrapper.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gjs/jsapi-wrapper.h b/gjs/jsapi-wrapper.h
index a282b2d..3627c25 100644
--- a/gjs/jsapi-wrapper.h
+++ b/gjs/jsapi-wrapper.h
@@ -25,6 +25,12 @@
 #ifndef GJS_JSAPI_WRAPPER_H
 #define GJS_JSAPI_WRAPPER_H
 
+#include <js-config.h>  /* SpiderMonkey's #defines that affect public API */
+/* COMPAT: SpiderMonkey headers in some places use DEBUG instead of JS_DEBUG */
+#if defined(JS_DEBUG) && JS_DEBUG
+#define DEBUG 1
+#endif
+
 #if defined(__clang__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
 #pragma GCC system_header
 #endif


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