Commit 8c620006 authored by Philip Chimento's avatar Philip Chimento 🚮 Committed by Philip Chimento

build: Make a jsapi.h "system header" wrapper

We got rid of all the "compat" stuff in compat.h already, before this
commit it only included jsapi.h, jsdbgapi.h, and jsapi-util.h, wrapping
the former two in some diagnostic pragmas. If we get rid of the
jsapi-util.h include, then we can use a system_header pragma to mark it
as a system header so that we don't have to painstakingly maintain all
those diagnostic pragmas.

(The system_header pragma ignores all warnings coming from that file:
https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html)

Since compat.h already wasn't a fitting name anymore, rename the header
to jsapi-wrapper.h.

https://bugzilla.gnome.org/show_bug.cgi?id=773297
parent f3dd1d3c
......@@ -145,11 +145,11 @@ libgjs_la_SOURCES += $(libgjs_private_source_files)
# These used to be public headers for external modules
libgjs_la_SOURCES += \
gjs/compat.h \
gjs/coverage.h \
gjs/byteArray.h \
gjs/importer.h \
gjs/jsapi-util.h \
gjs/jsapi-wrapper.h \
gjs/runtime.h \
gjs/type-module.h \
gjs/mem.h \
......
......@@ -35,8 +35,7 @@
#include "value.h"
#include "gerror.h"
#include "gjs/byteArray.h"
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include <util/log.h>
bool
......
......@@ -28,7 +28,7 @@
#include "boxed.h"
#include "arg.h"
#include "object.h"
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include "gjs/mem.h"
#include "repo.h"
#include "proxyutils.h"
......
......@@ -28,7 +28,7 @@
#include <util/log.h>
#include "closure.h"
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include "gjs/mem.h"
#include "keep-alive.h"
......
......@@ -25,7 +25,7 @@
#include <string.h>
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include "repo.h"
#include "gtype.h"
#include "function.h"
......
......@@ -28,7 +28,7 @@
#include "arg.h"
#include "foreign.h"
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
static struct {
char *gi_namespace;
......
......@@ -33,8 +33,8 @@
#include "closure.h"
#include "gtype.h"
#include "param.h"
#include "gjs/compat.h"
#include "gjs/jsapi-private.h"
#include "gjs/jsapi-wrapper.h"
#include "gjs/mem.h"
#include <util/log.h>
......
......@@ -33,7 +33,7 @@
#include "gtype.h"
#include "proxyutils.h"
#include "repo.h"
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include "gjs/mem.h"
#include <gjs/context.h>
......
......@@ -27,7 +27,7 @@
#include "boxed.h"
#include "enumeration.h"
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include "gjs/mem.h"
#include "repo.h"
#include "gerror.h"
......
......@@ -25,8 +25,7 @@
#include <config.h>
#include "gtype.h"
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include <util/log.h>
#include <girepository.h>
......
......@@ -28,7 +28,7 @@
#include "gtype.h"
#include "interface.h"
#include "repo.h"
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include "gjs/mem.h"
#include <util/log.h>
......
......@@ -23,7 +23,7 @@
#include <config.h>
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include "keep-alive.h"
#include <util/log.h>
......
......@@ -26,7 +26,7 @@
#include "ns.h"
#include "repo.h"
#include "param.h"
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include "gjs/mem.h"
#include <util/log.h>
......
......@@ -41,7 +41,7 @@
#include "keep-alive.h"
#include "closure.h"
#include "gjs_gi_trace.h"
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include "gjs/context-private.h"
#include "gjs/mem.h"
#include "gjs/type-module.h"
......
......@@ -31,7 +31,7 @@
#include "repo.h"
#include "gtype.h"
#include "function.h"
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include "gjs/mem.h"
#include <util/log.h>
......
......@@ -36,8 +36,7 @@
#include "fundamental.h"
#include "interface.h"
#include "gerror.h"
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include "gjs/jsapi-private.h"
#include "gjs/mem.h"
......
......@@ -29,7 +29,7 @@
#include <girepository.h>
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include <util/log.h>
G_BEGIN_DECLS
......
......@@ -31,7 +31,7 @@
#include "union.h"
#include "arg.h"
#include "object.h"
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include "gjs/mem.h"
#include "repo.h"
#include "proxyutils.h"
......
......@@ -36,7 +36,7 @@
#include "union.h"
#include "gtype.h"
#include "gerror.h"
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include <girepository.h>
......
......@@ -26,7 +26,7 @@
#include <glib.h>
#include "byteArray.h"
#include "gi/boxed.h"
#include "compat.h"
#include "jsapi-wrapper.h"
#include "jsapi-util-args.h"
#include <girepository.h>
#include <util/log.h>
......
......@@ -25,7 +25,6 @@
#define __GJS_CONTEXT_PRIVATE_H__
#include "context.h"
#include "compat.h"
G_BEGIN_DECLS
......
......@@ -29,9 +29,9 @@
#include "importer.h"
#include "jsapi-private.h"
#include "jsapi-util.h"
#include "jsapi-wrapper.h"
#include "native.h"
#include "byteArray.h"
#include "compat.h"
#include "runtime.h"
#include "gi.h"
......
......@@ -28,7 +28,7 @@
#include <string.h>
#include "gjs/native.h"
#include "gjs/compat.h"
#include "gjs/jsapi-wrapper.h"
#include "gi/repo.h"
bool
......
......@@ -26,8 +26,8 @@
#include <util/log.h>
#include <util/glib.h>
#include "compat.h"
#include "importer.h"
#include "jsapi-wrapper.h"
#include "mem.h"
#include "native.h"
......
......@@ -29,7 +29,7 @@
#include <util/misc.h>
#include "jsapi-util.h"
#include "compat.h"
#include "jsapi-wrapper.h"
#include "jsapi-private.h"
#include <string.h>
......
......@@ -29,7 +29,7 @@
#include "jsapi-util.h"
#include "jsapi-private.h"
#include "compat.h"
#include "jsapi-wrapper.h"
#include <string.h>
#pragma GCC diagnostic push
......
......@@ -27,7 +27,8 @@
#include <glib.h>
#include "compat.h"
#include "jsapi-util.h"
#include "jsapi-wrapper.h"
static inline bool
check_nullable(const char*& fchar,
......
......@@ -24,7 +24,7 @@
#include <config.h>
#include "jsapi-util.h"
#include "compat.h"
#include "jsapi-wrapper.h"
#include "gi/gerror.h"
#include <util/log.h>
......
......@@ -26,7 +26,7 @@
#include <string.h>
#include "jsapi-util.h"
#include "compat.h"
#include "jsapi-wrapper.h"
JSBool
gjs_string_to_utf8 (JSContext *context,
......
......@@ -30,7 +30,7 @@
#include <util/error.h>
#include "jsapi-util.h"
#include "compat.h"
#include "jsapi-wrapper.h"
#include "context-private.h"
#include "jsapi-private.h"
#include <gi/boxed.h>
......
......@@ -28,7 +28,7 @@
#include <glib-object.h>
#include "gjs/compat.h"
#include "jsapi-wrapper.h"
#include "gjs/runtime.h"
#include "gi/gtype.h"
......
......@@ -22,26 +22,13 @@
* IN THE SOFTWARE.
*/
#ifndef __GJS_COMPAT_H__
#define __GJS_COMPAT_H__
#ifndef GJS_JSAPI_WRAPPER_H
#define GJS_JSAPI_WRAPPER_H
#if defined(__clang__)
_Pragma("clang diagnostic push")
_Pragma("clang diagnostic ignored \"-Wuninitialized\"")
_Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"")
#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Wstrict-prototypes\"")
_Pragma("GCC diagnostic ignored \"-Winvalid-offsetof\"")
#if defined(__clang__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
#pragma GCC system_header
#endif
#include <jsapi.h>
#include <jsdbgapi.h> // Needed by some bits
#if defined(__clang__)
_Pragma("clang diagnostic pop")
#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
_Pragma("GCC diagnostic pop")
#endif
#include "jsapi-util.h"
#endif /* __GJS_COMPAT_H__ */
#endif /* GJS_JSAPI_WRAPPER_H */
......@@ -24,7 +24,6 @@
#include <config.h>
#include "mem.h"
#include "compat.h"
#include <util/log.h>
#define GJS_DEFINE_COUNTER(name) \
......
......@@ -28,7 +28,7 @@
#include <util/log.h>
#include "native.h"
#include "compat.h"
#include "jsapi-wrapper.h"
#include "jsapi-util.h"
static GHashTable *modules = NULL;
......
......@@ -23,7 +23,8 @@
#include <config.h>
#include "compat.h"
#include "jsapi-util.h"
#include "jsapi-wrapper.h"
#include "runtime.h"
struct RuntimeData {
......
......@@ -44,8 +44,8 @@
#include <glib.h>
#include <string.h>
#include "context.h"
#include "compat.h"
#include "jsapi-util.h"
#include "jsapi-wrapper.h"
bool
gjs_context_get_frame_info(JSContext *context,
......
......@@ -22,9 +22,9 @@
#include <config.h>
#include "gjs/compat.h"
#include "gi/foreign.h"
#include "gjs/jsapi-util-args.h"
#include "gjs/jsapi-wrapper.h"
#include <cairo.h>
#include <cairo-gobject.h>
......
......@@ -22,8 +22,8 @@
#include <config.h>
#include "gjs/compat.h"
#include "gjs/jsapi-util-args.h"
#include "gjs/jsapi-wrapper.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,8 +22,9 @@
#include <config.h>
#include "gjs/compat.h"
#include "gjs/jsapi-util.h"
#include "gjs/jsapi-util-args.h"
#include "gjs/jsapi-wrapper.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,8 +22,8 @@
#include <config.h>
#include "gjs/compat.h"
#include "gjs/jsapi-util-args.h"
#include "gjs/jsapi-wrapper.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,7 +22,8 @@
#include <config.h>
#include "gjs/compat.h"
#include "gjs/jsapi-util.h"
#include "gjs/jsapi-wrapper.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,7 +22,8 @@
#include <config.h>
#include "gjs/compat.h"
#include "gjs/jsapi-util.h"
#include "gjs/jsapi-wrapper.h"
#include <cairo.h>
#include <cairo-gobject.h>
#include "cairo-private.h"
......
......@@ -22,8 +22,8 @@
#include <config.h>
#include "gjs/compat.h"
#include "gjs/jsapi-util-args.h"
#include "gjs/jsapi-wrapper.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,8 +22,8 @@
#include <config.h>
#include "gjs/compat.h"
#include "gjs/jsapi-util-args.h"
#include "gjs/jsapi-wrapper.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,8 +22,8 @@
#include <config.h>
#include "gjs/compat.h"
#include "gjs/jsapi-util-args.h"
#include "gjs/jsapi-wrapper.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,9 +22,9 @@
#include <config.h>
#include "gjs/compat.h"
#include "gi/foreign.h"
#include "gjs/jsapi-util-args.h"
#include "gjs/jsapi-wrapper.h"
#include <cairo.h>
#include <cairo-gobject.h>
......
......@@ -22,8 +22,8 @@
#include <config.h>
#include "gjs/compat.h"
#include "gjs/jsapi-util-args.h"
#include "gjs/jsapi-wrapper.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,8 +22,8 @@
#include <config.h>
#include "gjs/compat.h"
#include "gjs/jsapi-util-args.h"
#include "gjs/jsapi-wrapper.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,9 +22,9 @@
#include <config.h>
#include "gjs/compat.h"
#include "gi/foreign.h"
#include "gjs/jsapi-util-args.h"
#include "gjs/jsapi-wrapper.h"
#include <cairo.h>
#include <cairo-gobject.h>
#include "cairo-private.h"
......
......@@ -22,8 +22,8 @@
#include <config.h>
#include "gjs/compat.h"
#include "gjs/jsapi-util-args.h"
#include "gjs/jsapi-wrapper.h"
#include <cairo.h>
#include "cairo-private.h"
......
......@@ -22,7 +22,8 @@
#include <config.h>
#include "gjs/compat.h"
#include "gjs/jsapi-util.h"
#include "gjs/jsapi-wrapper.h"
#include "cairo-private.h"
#if CAIRO_HAS_XLIB_SURFACE
......
......@@ -53,8 +53,8 @@
#include <glib/gprintf.h>
#include "console.h"
#include "gjs/compat.h"
#include "gjs/jsapi-private.h"
#include "gjs/jsapi-wrapper.h"
static void
gjs_console_error_reporter(JSContext *cx, const char *message, JSErrorReport *report)
......
......@@ -2,9 +2,9 @@
#include <glib.h>
#include "gjs/compat.h"
#include "gjs/context.h"
#include "gjs/jsapi-util-args.h"
#include "gjs/jsapi-wrapper.h"
#include "test/gjs-test-utils.h"
#define assert_match(str, pattern) \
......
......@@ -31,8 +31,9 @@
#include <glib.h>
#include "gjs/compat.h"
#include "gjs/context.h"
#include "gjs/jsapi-util.h"
#include "gjs/jsapi-wrapper.h"
#include "gjs-test-utils.h"
static void
......
......@@ -27,8 +27,8 @@
#include <util/glib.h>
#include <gjs/context.h>
#include "gjs/compat.h"
#include "gjs/jsapi-util.h"
#include "gjs/jsapi-wrapper.h"
#include "gjs-test-utils.h"
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment