[gjs: 9/21] maint: Unify header guard style across all headers



commit 494dc062456f1883e31a8703bdf597882a334cf8
Author: Philip Chimento <philip chimento gmail com>
Date:   Fri May 31 23:09:00 2019 -0700

    maint: Unify header guard style across all headers
    
    We have a number of different header guard styles in use and some of
    them are applied inconsistently. Use the style recommended by cpplint:
    
        #ifndef SUBDIR_HEADER_H_
        #define SUBDIR_HEADER_H_
        ...
        #endif  // SUBDIR_HEADER_H_
    
    (with the C++-style comment replaced by a C-style comment in C files.)
    
    In installed headers, consistently add an extra guard that requires the
    header to be included via <gjs/gjs.h> instead of included directly.

 gi/arg.h                           |  6 +++---
 gi/boxed.h                         |  6 +++---
 gi/closure.h                       |  6 +++---
 gi/enumeration.h                   |  6 +++---
 gi/foreign.h                       |  6 +++---
 gi/function.h                      |  6 +++---
 gi/fundamental.h                   |  6 +++---
 gi/gerror.h                        |  6 +++---
 gi/gjs_gi_trace.h                  |  7 +++----
 gi/gtype.h                         |  6 +++---
 gi/interface.h                     |  6 +++---
 gi/ns.h                            |  6 +++---
 gi/object.h                        |  6 +++---
 gi/param.h                         |  6 +++---
 gi/repo.h                          |  6 +++---
 gi/toggle.h                        |  6 +++---
 gi/union.h                         |  6 +++---
 gi/value.h                         |  6 +++---
 gjs/byteArray.h                    |  6 +++---
 gjs/context-private.h              |  6 +++---
 gjs/context.h                      | 10 +++++-----
 gjs/coverage.h                     | 10 +++++++---
 gjs/deprecation.h                  |  2 +-
 gjs/engine.h                       |  6 +++---
 gjs/gjs.h                          | 10 +++++++---
 gjs/global.h                       |  6 +++---
 gjs/importer.h                     |  6 +++---
 gjs/jsapi-class.h                  |  6 +++---
 gjs/jsapi-util-args.h              |  5 +++++
 gjs/jsapi-util-root.h              |  6 +++---
 gjs/jsapi-util.h                   |  6 +++---
 gjs/jsapi-wrapper.h                |  6 +++---
 gjs/macros.h                       |  6 +++---
 gjs/mem.h                          | 10 +++++++---
 gjs/module.h                       |  6 +++---
 gjs/native.h                       |  6 +++---
 gjs/profiler-private.h             |  6 +++---
 gjs/profiler.h                     | 10 +++++++---
 libgjs-private/gjs-gdbus-wrapper.h |  6 +++---
 libgjs-private/gjs-gtk-util.h      |  6 +++---
 libgjs-private/gjs-util.h          |  6 +++---
 modules/cairo-module.h             |  6 +++---
 modules/cairo-private.h            |  7 +++----
 modules/console.h                  |  6 +++---
 modules/modules.h                  |  6 +++---
 modules/system.h                   |  6 +++---
 test/gjs-test-utils.h              |  6 +++---
 util/error.h                       | 10 +++++++---
 util/glib.h                        |  6 +++---
 util/log.h                         |  6 +++---
 util/misc.h                        |  6 +++---
 51 files changed, 175 insertions(+), 152 deletions(-)
---
diff --git a/gi/arg.h b/gi/arg.h
index 751a2330..c35ee419 100644
--- a/gi/arg.h
+++ b/gi/arg.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_ARG_H__
-#define __GJS_ARG_H__
+#ifndef GI_ARG_H_
+#define GI_ARG_H_
 
 #include <stdbool.h>
 #include <glib.h>
@@ -125,4 +125,4 @@ bool gjs_array_to_strv (JSContext   *context,
 
 G_END_DECLS
 
-#endif  /* __GJS_ARG_H__ */
+#endif  // GI_ARG_H_
diff --git a/gi/boxed.h b/gi/boxed.h
index 2d5d20bc..9b571cc4 100644
--- a/gi/boxed.h
+++ b/gi/boxed.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_BOXED_H__
-#define __GJS_BOXED_H__
+#ifndef GI_BOXED_H_
+#define GI_BOXED_H_
 
 #include <girepository.h>
 #include <glib.h>
@@ -240,4 +240,4 @@ class BoxedInstance
                                       void* gboxed, NoCopy);
 };
 
-#endif  /* __GJS_BOXED_H__ */
+#endif  // GI_BOXED_H_
diff --git a/gi/closure.h b/gi/closure.h
index 33cc5341..c7410ab4 100644
--- a/gi/closure.h
+++ b/gi/closure.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_CLOSURE_H__
-#define __GJS_CLOSURE_H__
+#ifndef GI_CLOSURE_H_
+#define GI_CLOSURE_H_
 
 #include <stdbool.h>
 #include <glib-object.h>
@@ -55,4 +55,4 @@ void       gjs_closure_trace         (GClosure     *closure,
 
 G_END_DECLS
 
-#endif  /* __GJS_CLOSURE_H__ */
+#endif  // GI_CLOSURE_H_
diff --git a/gi/enumeration.h b/gi/enumeration.h
index 7a81c027..d9a9e8f4 100644
--- a/gi/enumeration.h
+++ b/gi/enumeration.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_ENUMERATION_H__
-#define __GJS_ENUMERATION_H__
+#ifndef GI_ENUMERATION_H_
+#define GI_ENUMERATION_H_
 
 #include <stdbool.h>
 #include <glib.h>
@@ -46,4 +46,4 @@ bool gjs_define_enumeration(JSContext       *context,
 
 G_END_DECLS
 
-#endif  /* __GJS_ENUMERATION_H__ */
+#endif  // GI_ENUMERATION_H_
diff --git a/gi/foreign.h b/gi/foreign.h
index 385eedae..b2644f20 100644
--- a/gi/foreign.h
+++ b/gi/foreign.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_OVERRIDE_H__
-#define __GJS_OVERRIDE_H__
+#ifndef GI_FOREIGN_H_
+#define GI_FOREIGN_H_
 
 #include <stdbool.h>
 #include <girepository.h>
@@ -76,4 +76,4 @@ bool  gjs_struct_foreign_release_g_argument      (JSContext      *context,
                                                   GIBaseInfo     *interface_info,
                                                   GArgument      *arg);
 
-#endif /* __GJS_OVERRIDE_H__ */
+#endif  // GI_FOREIGN_H_
diff --git a/gi/function.h b/gi/function.h
index 16e0fa29..3b593f2f 100644
--- a/gi/function.h
+++ b/gi/function.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_FUNCTION_H__
-#define __GJS_FUNCTION_H__
+#ifndef GI_FUNCTION_H_
+#define GI_FUNCTION_H_
 
 #include <stdbool.h>
 #include <glib.h>
@@ -86,4 +86,4 @@ bool gjs_invoke_constructor_from_c(JSContext                  *context,
 
 G_END_DECLS
 
-#endif  /* __GJS_FUNCTION_H__ */
+#endif  // GI_FUNCTION_H_
diff --git a/gi/fundamental.h b/gi/fundamental.h
index 5c0d5298..aea7e35a 100644
--- a/gi/fundamental.h
+++ b/gi/fundamental.h
@@ -22,8 +22,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_FUNDAMENTAL_H__
-#define __GJS_FUNDAMENTAL_H__
+#ifndef GI_FUNDAMENTAL_H_
+#define GI_FUNDAMENTAL_H_
 
 #include <stdbool.h>
 #include <glib.h>
@@ -185,4 +185,4 @@ class FundamentalInstance
     static void* copy_ptr(JSContext* cx, GType gtype, void* gfundamental);
 };
 
-#endif  /* __GJS_FUNDAMENTAL_H__ */
+#endif  // GI_FUNDAMENTAL_H_
diff --git a/gi/gerror.h b/gi/gerror.h
index a78afdef..ea11aab5 100644
--- a/gi/gerror.h
+++ b/gi/gerror.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_ERROR_H__
-#define __GJS_ERROR_H__
+#ifndef GI_GERROR_H_
+#define GI_GERROR_H_
 
 #include <stdbool.h>
 #include <glib.h>
@@ -181,4 +181,4 @@ bool gjs_throw_gerror(JSContext* cx, GError* error);
 
 G_END_DECLS
 
-#endif  /* __GJS_ERROR_H__ */
+#endif  // GI_GERROR_H_
diff --git a/gi/gjs_gi_trace.h b/gi/gjs_gi_trace.h
index 2b8b15de..ff9758cb 100644
--- a/gi/gjs_gi_trace.h
+++ b/gi/gjs_gi_trace.h
@@ -23,9 +23,8 @@
  * Author: Colin Walters <walters verbum org>
  */
 
-
-#ifndef __GJS_TRACE_H__
-#define __GJS_TRACE_H__
+#ifndef GI_GJS_GI_TRACE_H_
+#define GI_GJS_GI_TRACE_H_
 
 #ifndef GJS_VERSION
 #    error "config.h must be included prior to gjs_trace.h"
@@ -44,4 +43,4 @@
 
 #endif
 
-#endif /* __GJS_TRACE_H__ */
+#endif  // GI_GJS_GI_TRACE_H_
diff --git a/gi/gtype.h b/gi/gtype.h
index b53ac5ce..867fd34d 100644
--- a/gi/gtype.h
+++ b/gi/gtype.h
@@ -22,8 +22,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_GTYPE_H__
-#define __GJS_GTYPE_H__
+#ifndef GI_GTYPE_H_
+#define GI_GTYPE_H_
 
 #include <stdbool.h>
 #include <glib.h>
@@ -49,4 +49,4 @@ bool        gjs_typecheck_gtype         (JSContext             *context,
 
 G_END_DECLS
 
-#endif  /* __GJS_INTERFACE_H__ */
+#endif  // GI_GTYPE_H_
diff --git a/gi/interface.h b/gi/interface.h
index f7fc4385..f108e7de 100644
--- a/gi/interface.h
+++ b/gi/interface.h
@@ -22,8 +22,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_INTERFACE_H__
-#define __GJS_INTERFACE_H__
+#ifndef GI_INTERFACE_H_
+#define GI_INTERFACE_H_
 
 #include <stdbool.h>
 #include <glib.h>
@@ -134,4 +134,4 @@ bool gjs_lookup_interface_constructor(JSContext             *context,
 
 G_END_DECLS
 
-#endif  /* __GJS_INTERFACE_H__ */
+#endif  // GI_INTERFACE_H_
diff --git a/gi/ns.h b/gi/ns.h
index 9035e9d8..8245018e 100644
--- a/gi/ns.h
+++ b/gi/ns.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_NS_H__
-#define __GJS_NS_H__
+#ifndef GI_NS_H_
+#define GI_NS_H_
 
 #include <glib.h>
 #include <girepository.h>
@@ -38,4 +38,4 @@ JSObject* gjs_create_ns(JSContext    *context,
 
 G_END_DECLS
 
-#endif  /* __GJS_NS_H__ */
+#endif  // GI_NS_H_
diff --git a/gi/object.h b/gi/object.h
index 8ee35358..2225ab78 100644
--- a/gi/object.h
+++ b/gi/object.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_OBJECT_H__
-#define __GJS_OBJECT_H__
+#ifndef GI_OBJECT_H_
+#define GI_OBJECT_H_
 
 #include <glib-object.h>
 #include <girepository.h>
@@ -464,4 +464,4 @@ void gjs_object_shutdown_toggle_queue(void);
 
 G_END_DECLS
 
-#endif  /* __GJS_OBJECT_H__ */
+#endif  // GI_OBJECT_H_
diff --git a/gi/param.h b/gi/param.h
index adb4657c..32a04a72 100644
--- a/gi/param.h
+++ b/gi/param.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_PARAM_H__
-#define __GJS_PARAM_H__
+#ifndef GI_PARAM_H_
+#define GI_PARAM_H_
 
 #include <stdbool.h>
 #include <glib.h>
@@ -53,4 +53,4 @@ bool        gjs_typecheck_param(JSContext       *context,
 
 G_END_DECLS
 
-#endif  /* __GJS_PARAM_H__ */
+#endif  // GI_PARAM_H_
diff --git a/gi/repo.h b/gi/repo.h
index d5e3226b..0e26c7a6 100644
--- a/gi/repo.h
+++ b/gi/repo.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_REPO_H__
-#define __GJS_REPO_H__
+#ifndef GI_REPO_H_
+#define GI_REPO_H_
 
 #include <stdbool.h>
 #include <glib.h>
@@ -77,4 +77,4 @@ void _gjs_log_info_usage(GIBaseInfo *info);
 
 G_END_DECLS
 
-#endif  /* __GJS_REPO_H__ */
+#endif  // GI_REPO_H_
diff --git a/gi/toggle.h b/gi/toggle.h
index d2da51cd..44db802f 100644
--- a/gi/toggle.h
+++ b/gi/toggle.h
@@ -23,8 +23,8 @@
  * Authored by: Philip Chimento <philip endlessm com>, <philip chimento gmail com>
  */
 
-#ifndef GJS_TOGGLE_H
-#define GJS_TOGGLE_H
+#ifndef GI_TOGGLE_H_
+#define GI_TOGGLE_H_
 
 #include <atomic>
 #include <deque>
@@ -111,4 +111,4 @@ private:
     }
 };
 
-#endif  /* GJS_TOGGLE_H */
+#endif  // GI_TOGGLE_H_
diff --git a/gi/union.h b/gi/union.h
index 958ea86a..58769691 100644
--- a/gi/union.h
+++ b/gi/union.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_UNION_H__
-#define __GJS_UNION_H__
+#ifndef GI_UNION_H_
+#define GI_UNION_H_
 
 #include <stdbool.h>
 #include <glib.h>
@@ -111,4 +111,4 @@ JSObject* gjs_union_from_c_union       (JSContext    *context,
 
 G_END_DECLS
 
-#endif  /* __GJS_UNION_H__ */
+#endif  // GI_UNION_H_
diff --git a/gi/value.h b/gi/value.h
index ab9f8194..2343e42a 100644
--- a/gi/value.h
+++ b/gi/value.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_VALUE_H__
-#define __GJS_VALUE_H__
+#ifndef GI_VALUE_H_
+#define GI_VALUE_H_
 
 #include <stdbool.h>
 #include <glib-object.h>
@@ -56,4 +56,4 @@ GClosure* gjs_closure_new_for_signal(JSContext* cx, JSFunction* callable,
 
 G_END_DECLS
 
-#endif  /* __GJS_VALUE_H__ */
+#endif  // GI_VALUE_H_
diff --git a/gjs/byteArray.h b/gjs/byteArray.h
index 59456ea8..6d0ea2cc 100644
--- a/gjs/byteArray.h
+++ b/gjs/byteArray.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_BYTE_ARRAY_H__
-#define __GJS_BYTE_ARRAY_H__
+#ifndef GJS_BYTEARRAY_H_
+#define GJS_BYTEARRAY_H_
 
 #include <stdbool.h>
 #include <glib.h>
@@ -51,4 +51,4 @@ GBytes* gjs_byte_array_get_bytes(JS::HandleObject obj);
 
 G_END_DECLS
 
-#endif  /* __GJS_BYTE_ARRAY_H__ */
+#endif  // GJS_BYTEARRAY_H_
diff --git a/gjs/context-private.h b/gjs/context-private.h
index 274352fa..262cadb1 100644
--- a/gjs/context-private.h
+++ b/gjs/context-private.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_CONTEXT_PRIVATE_H__
-#define __GJS_CONTEXT_PRIVATE_H__
+#ifndef GJS_CONTEXT_PRIVATE_H_
+#define GJS_CONTEXT_PRIVATE_H_
 
 #include <inttypes.h>
 
@@ -203,4 +203,4 @@ class GjsContextPrivate {
     void dispose(void);
 };
 
-#endif  /* __GJS_CONTEXT_PRIVATE_H__ */
+#endif  // GJS_CONTEXT_PRIVATE_H_
diff --git a/gjs/context.h b/gjs/context.h
index 2b54b6bf..5ac5e65e 100644
--- a/gjs/context.h
+++ b/gjs/context.h
@@ -21,11 +21,11 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_CONTEXT_H__
-#define __GJS_CONTEXT_H__
+#ifndef GJS_CONTEXT_H_
+#define GJS_CONTEXT_H_
 
-#if !defined (__GJS_GJS_H__) && !defined (GJS_COMPILATION)
-#error "Only <gjs/gjs.h> can be included directly."
+#if !defined(INSIDE_GJS_H) && !defined(GJS_COMPILATION)
+#    error "Only <gjs/gjs.h> can be included directly."
 #endif
 
 #include <stdbool.h>
@@ -96,4 +96,4 @@ void gjs_context_setup_debugger_console(GjsContext* gjs);
 
 G_END_DECLS
 
-#endif  /* __GJS_CONTEXT_H__ */
+#endif /* GJS_CONTEXT_H_ */
diff --git a/gjs/coverage.h b/gjs/coverage.h
index 0820d9f1..3e93a339 100644
--- a/gjs/coverage.h
+++ b/gjs/coverage.h
@@ -23,8 +23,12 @@
  * Authored By: Sam Spilsbury <sam endlessm com>
  */
 
-#ifndef _GJS_COVERAGE_H
-#define _GJS_COVERAGE_H
+#ifndef GJS_COVERAGE_H_
+#define GJS_COVERAGE_H_
+
+#if !defined(INSIDE_GJS_H) && !defined(GJS_COMPILATION)
+#    error "Only <gjs/gjs.h> can be included directly."
+#endif
 
 #include <glib-object.h>
 #include <gio/gio.h>
@@ -47,4 +51,4 @@ GJS_EXPORT GJS_USE GjsCoverage* gjs_coverage_new(
 
 G_END_DECLS
 
-#endif
+#endif /* GJS_COVERAGE_H_ */
diff --git a/gjs/deprecation.h b/gjs/deprecation.h
index 8ed98e3d..a76d9d35 100644
--- a/gjs/deprecation.h
+++ b/gjs/deprecation.h
@@ -34,4 +34,4 @@ enum GjsDeprecationMessageId {
 void _gjs_warn_deprecated_once_per_callsite(JSContext* cx,
                                             GjsDeprecationMessageId message);
 
-#endif  /* GJS_DEPRECATION_H_ */
+#endif  // GJS_DEPRECATION_H_
diff --git a/gjs/engine.h b/gjs/engine.h
index 8b14540f..250255fe 100644
--- a/gjs/engine.h
+++ b/gjs/engine.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef GJS_ENGINE_H
-#define GJS_ENGINE_H
+#ifndef GJS_ENGINE_H_
+#define GJS_ENGINE_H_
 
 #include "gjs/context-private.h"
 #include "jsapi-wrapper.h"
@@ -32,4 +32,4 @@ JSContext* gjs_create_js_context(GjsContextPrivate* uninitialized_gjs);
 bool gjs_load_internal_source(JSContext* cx, const char* filename,
                               JS::UniqueTwoByteChars* src, size_t* length);
 
-#endif  /* GJS_ENGINE_H */
+#endif  // GJS_ENGINE_H_
diff --git a/gjs/gjs.h b/gjs/gjs.h
index 99776561..f1535d89 100644
--- a/gjs/gjs.h
+++ b/gjs/gjs.h
@@ -21,8 +21,10 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_GJS_H__
-#define __GJS_GJS_H__
+#ifndef GJS_GJS_H_
+#define GJS_GJS_H_
+
+#define INSIDE_GJS_H
 
 #include <gjs/context.h>
 #include <gjs/coverage.h>
@@ -31,4 +33,6 @@
 #include <gjs/profiler.h>
 #include <util/error.h>
 
-#endif /* __GJS_GJS_H__ */
+#undef INSIDE_GJS_H
+
+#endif /* GJS_GJS_H_ */
diff --git a/gjs/global.h b/gjs/global.h
index 49ea8098..ef3be6c3 100644
--- a/gjs/global.h
+++ b/gjs/global.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef GJS_GLOBAL_H
-#define GJS_GLOBAL_H
+#ifndef GJS_GLOBAL_H_
+#define GJS_GLOBAL_H_
 
 #include <glib.h>
 
@@ -72,4 +72,4 @@ G_END_DECLS
 
 JS::Value gjs_get_global_slot(JSContext* cx, GjsGlobalSlot slot);
 
-#endif  /* GJS_GLOBAL_H */
+#endif  // GJS_GLOBAL_H_
diff --git a/gjs/importer.h b/gjs/importer.h
index 55baffbb..359c822a 100644
--- a/gjs/importer.h
+++ b/gjs/importer.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_IMPORTER_H__
-#define __GJS_IMPORTER_H__
+#ifndef GJS_IMPORTER_H_
+#define GJS_IMPORTER_H_
 
 #include <stdbool.h>
 #include <glib.h>
@@ -43,4 +43,4 @@ bool gjs_import_native_module(JSContext       *cx,
 
 G_END_DECLS
 
-#endif  /* __GJS_IMPORTER_H__ */
+#endif  // GJS_IMPORTER_H_
diff --git a/gjs/jsapi-class.h b/gjs/jsapi-class.h
index 4a3fcdba..90767731 100644
--- a/gjs/jsapi-class.h
+++ b/gjs/jsapi-class.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef GJS_JSAPI_CLASS_H
-#define GJS_JSAPI_CLASS_H
+#ifndef GJS_JSAPI_CLASS_H_
+#define GJS_JSAPI_CLASS_H_
 
 #include "gi/wrapperutils.h"
 #include "gjs/context-private.h"
@@ -326,4 +326,4 @@ G_END_DECLS
 GJS_USE
 JS::Value gjs_dynamic_property_private_slot(JSObject *accessor_obj);
 
-#endif /* GJS_JSAPI_CLASS_H */
+#endif  // GJS_JSAPI_CLASS_H_
diff --git a/gjs/jsapi-util-args.h b/gjs/jsapi-util-args.h
index de51d14f..99f39f59 100644
--- a/gjs/jsapi-util-args.h
+++ b/gjs/jsapi-util-args.h
@@ -23,6 +23,9 @@
  * Authored by: Philip Chimento <philip endlessm com>
  */
 
+#ifndef GJS_JSAPI_UTIL_ARGS_H_
+#define GJS_JSAPI_UTIL_ARGS_H_
+
 #include <type_traits>
 
 #include <glib.h>
@@ -388,3 +391,5 @@ GJS_JSAPI_RETURN_CONVENTION static bool gjs_parse_call_args(
     return parse_call_args_helper(cx, function_name, args, fmt_required,
                                   fmt_optional, 0, params...);
 }
+
+#endif  // GJS_JSAPI_UTIL_ARGS_H_
diff --git a/gjs/jsapi-util-root.h b/gjs/jsapi-util-root.h
index f2df93e4..1457387d 100644
--- a/gjs/jsapi-util-root.h
+++ b/gjs/jsapi-util-root.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef GJS_JSAPI_UTIL_ROOT_H
-#define GJS_JSAPI_UTIL_ROOT_H
+#ifndef GJS_JSAPI_UTIL_ROOT_H_
+#define GJS_JSAPI_UTIL_ROOT_H_
 
 #include <glib.h>
 #include <glib-object.h>
@@ -368,4 +368,4 @@ public:
     GJS_USE bool rooted(void) const { return m_rooted; }
 };
 
-#endif /* GJS_JSAPI_UTIL_ROOT_H */
+#endif  // GJS_JSAPI_UTIL_ROOT_H_
diff --git a/gjs/jsapi-util.h b/gjs/jsapi-util.h
index 1863237b..f0d9a3f0 100644
--- a/gjs/jsapi-util.h
+++ b/gjs/jsapi-util.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_JSAPI_UTIL_H__
-#define __GJS_JSAPI_UTIL_H__
+#ifndef GJS_JSAPI_UTIL_H_
+#define GJS_JSAPI_UTIL_H_
 
 #include <memory>
 #include <string>
@@ -361,4 +361,4 @@ char* gjs_hyphen_to_underscore(const char* str);
 GJS_USE std::wstring gjs_win32_vc140_utf8_to_utf16(const char* str);
 #endif
 
-#endif  /* __GJS_JSAPI_UTIL_H__ */
+#endif  // GJS_JSAPI_UTIL_H_
diff --git a/gjs/jsapi-wrapper.h b/gjs/jsapi-wrapper.h
index 1eb06563..0c27918e 100644
--- a/gjs/jsapi-wrapper.h
+++ b/gjs/jsapi-wrapper.h
@@ -22,8 +22,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef GJS_JSAPI_WRAPPER_H
-#define GJS_JSAPI_WRAPPER_H
+#ifndef GJS_JSAPI_WRAPPER_H_
+#define GJS_JSAPI_WRAPPER_H_
 
 #include <config.h>
 
@@ -42,4 +42,4 @@
 #include <jsfriendapi.h>
 #include <js/Conversions.h>
 
-#endif  /* GJS_JSAPI_WRAPPER_H */
+#endif  // GJS_JSAPI_WRAPPER_H_
diff --git a/gjs/macros.h b/gjs/macros.h
index 5f36b1e0..e2066eed 100644
--- a/gjs/macros.h
+++ b/gjs/macros.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef GJS_MACROS_H
-#define GJS_MACROS_H
+#ifndef GJS_MACROS_H_
+#define GJS_MACROS_H_
 
 #include <glib.h>
 
@@ -70,4 +70,4 @@
 #    define GJS_ALWAYS_INLINE
 #endif
 
-#endif /* GJS_MACROS_H */
+#endif /* GJS_MACROS_H_ */
diff --git a/gjs/mem.h b/gjs/mem.h
index 769d1caf..720f2995 100644
--- a/gjs/mem.h
+++ b/gjs/mem.h
@@ -21,8 +21,12 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_MEM_H__
-#define __GJS_MEM_H__
+#ifndef GJS_MEM_H_
+#define GJS_MEM_H_
+
+#if !defined(INSIDE_GJS_H) && !defined(GJS_COMPILATION)
+#    error "Only <gjs/gjs.h> can be included directly."
+#endif
 
 #include <stdbool.h>
 #include <glib.h>
@@ -37,4 +41,4 @@ void gjs_memory_report(const char *where,
 
 G_END_DECLS
 
-#endif  /* __GJS_MEM_H__ */
+#endif  // GJS_MEM_H_
diff --git a/gjs/module.h b/gjs/module.h
index 89e2a331..06dd7dea 100644
--- a/gjs/module.h
+++ b/gjs/module.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef GJS_MODULE_H
-#define GJS_MODULE_H
+#ifndef GJS_MODULE_H_
+#define GJS_MODULE_H_
 
 #include <gio/gio.h>
 
@@ -41,4 +41,4 @@ gjs_module_import(JSContext       *cx,
 
 G_END_DECLS
 
-#endif  /* GJS_MODULE_H */
+#endif  // GJS_MODULE_H_
diff --git a/gjs/native.h b/gjs/native.h
index a0b4369e..72b675f0 100644
--- a/gjs/native.h
+++ b/gjs/native.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_NATIVE_H__
-#define __GJS_NATIVE_H__
+#ifndef GJS_NATIVE_H_
+#define GJS_NATIVE_H_
 
 #include <stdbool.h>
 #include <glib.h>
@@ -51,4 +51,4 @@ bool gjs_load_native_module(JSContext              *cx,
 
 G_END_DECLS
 
-#endif  /* __GJS_NATIVE_H__ */
+#endif  // GJS_NATIVE_H_
diff --git a/gjs/profiler-private.h b/gjs/profiler-private.h
index 42af367e..d2c1d424 100644
--- a/gjs/profiler-private.h
+++ b/gjs/profiler-private.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef GJS_PROFILER_PRIVATE_H
-#define GJS_PROFILER_PRIVATE_H
+#ifndef GJS_PROFILER_PRIVATE_H_
+#define GJS_PROFILER_PRIVATE_H_
 
 #include <stdint.h>
 
@@ -46,4 +46,4 @@ void _gjs_profiler_setup_signals(GjsProfiler *self, GjsContext *context);
 
 G_END_DECLS
 
-#endif  /* GJS_PROFILER_PRIVATE_H */
+#endif  // GJS_PROFILER_PRIVATE_H_
diff --git a/gjs/profiler.h b/gjs/profiler.h
index 95615bd4..35d00c6d 100644
--- a/gjs/profiler.h
+++ b/gjs/profiler.h
@@ -21,8 +21,12 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef GJS_PROFILER_H
-#define GJS_PROFILER_H
+#ifndef GJS_PROFILER_H_
+#define GJS_PROFILER_H_
+
+#if !defined(INSIDE_GJS_H) && !defined(GJS_COMPILATION)
+#    error "Only <gjs/gjs.h> can be included directly."
+#endif
 
 #include <glib.h>
 
@@ -51,4 +55,4 @@ void gjs_profiler_stop(GjsProfiler *self);
 
 G_END_DECLS
 
-#endif /* GJS_PROFILER_H */
+#endif  // GJS_PROFILER_H_
diff --git a/libgjs-private/gjs-gdbus-wrapper.h b/libgjs-private/gjs-gdbus-wrapper.h
index 33c59dc1..ebeee5cb 100644
--- a/libgjs-private/gjs-gdbus-wrapper.h
+++ b/libgjs-private/gjs-gdbus-wrapper.h
@@ -20,8 +20,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_UTIL_DBUS_H__
-#define __GJS_UTIL_DBUS_H__
+#ifndef LIBGJS_PRIVATE_GJS_GDBUS_WRAPPER_H_
+#define LIBGJS_PRIVATE_GJS_GDBUS_WRAPPER_H_
 
 #include <glib.h>
 #include <glib-object.h>
@@ -62,4 +62,4 @@ void                   gjs_dbus_implementation_emit_signal           (GjsDBusImp
 
 G_END_DECLS
 
-#endif  /* __GJS_UTIL_DBUS_H__ */
+#endif /* LIBGJS_PRIVATE_GJS_GDBUS_WRAPPER_H_ */
diff --git a/libgjs-private/gjs-gtk-util.h b/libgjs-private/gjs-gtk-util.h
index a47c5172..24f3a99b 100644
--- a/libgjs-private/gjs-gtk-util.h
+++ b/libgjs-private/gjs-gtk-util.h
@@ -20,8 +20,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_PRIVATE_GTK_UTIL_H__
-#define __GJS_PRIVATE_GTK_UTIL_H__
+#ifndef LIBGJS_PRIVATE_GJS_GTK_UTIL_H_
+#define LIBGJS_PRIVATE_GJS_GTK_UTIL_H_
 
 #include "config.h"
 
@@ -43,4 +43,4 @@ G_END_DECLS
 
 #endif
 
-#endif /* __GJS_PRIVATE_GTK_UTIL_H__ */
+#endif /* LIBGJS_PRIVATE_GJS_GTK_UTIL_H_ */
diff --git a/libgjs-private/gjs-util.h b/libgjs-private/gjs-util.h
index 4d8bd990..43b5e8cc 100644
--- a/libgjs-private/gjs-util.h
+++ b/libgjs-private/gjs-util.h
@@ -20,8 +20,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_PRIVATE_UTIL_H__
-#define __GJS_PRIVATE_UTIL_H__
+#ifndef LIBGJS_PRIVATE_GJS_UTIL_H_
+#define LIBGJS_PRIVATE_GJS_UTIL_H_
 
 #include <locale.h>
 #include <glib.h>
@@ -72,4 +72,4 @@ int gjs_open_bytes(GBytes* bytes, GError** error);
 
 G_END_DECLS
 
-#endif
+#endif /* LIBGJS_PRIVATE_GJS_UTIL_H_ */
diff --git a/modules/cairo-module.h b/modules/cairo-module.h
index 90a2265f..fdc7e643 100644
--- a/modules/cairo-module.h
+++ b/modules/cairo-module.h
@@ -20,8 +20,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __CAIRO_MODULE_H__
-#define __CAIRO_MODULE_H__
+#ifndef MODULES_CAIRO_MODULE_H_
+#define MODULES_CAIRO_MODULE_H_
 
 #include "gjs/jsapi-wrapper.h"
 #include "gjs/macros.h"
@@ -30,4 +30,4 @@ GJS_JSAPI_RETURN_CONVENTION
 bool gjs_js_define_cairo_stuff(JSContext              *context,
                                JS::MutableHandleObject module);
 
-#endif /* __CAIRO_MODULE_H__ */
+#endif  // MODULES_CAIRO_MODULE_H_
diff --git a/modules/cairo-private.h b/modules/cairo-private.h
index 1cd00969..cb75c7af 100644
--- a/modules/cairo-private.h
+++ b/modules/cairo-private.h
@@ -20,8 +20,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __CAIRO_PRIVATE_H__
-#define __CAIRO_PRIVATE_H__
+#ifndef MODULES_CAIRO_PRIVATE_H_
+#define MODULES_CAIRO_PRIVATE_H_
 
 #include "cairo-module.h"
 #include <cairo.h>
@@ -202,5 +202,4 @@ GJS_JSAPI_RETURN_CONVENTION
 JSObject *       gjs_cairo_solid_pattern_from_pattern   (JSContext       *context,
                                                          cairo_pattern_t *pattern);
 
-#endif /* __CAIRO_PRIVATE_H__ */
-
+#endif  // MODULES_CAIRO_PRIVATE_H_
diff --git a/modules/console.h b/modules/console.h
index 0f1dc8bf..364577b9 100644
--- a/modules/console.h
+++ b/modules/console.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_CONSOLE_H__
-#define __GJS_CONSOLE_H__
+#ifndef MODULES_CONSOLE_H_
+#define MODULES_CONSOLE_H_
 
 #include <config.h>
 #include <glib.h>
@@ -38,4 +38,4 @@ bool gjs_define_console_stuff(JSContext              *context,
 
 G_END_DECLS
 
-#endif  /* __GJS_CONSOLE_H__ */
+#endif  // MODULES_CONSOLE_H_
diff --git a/modules/modules.h b/modules/modules.h
index 21d4a0c5..18dfbc89 100644
--- a/modules/modules.h
+++ b/modules/modules.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_MODULES_H__
-#define __GJS_MODULES_H__
+#ifndef MODULES_MODULES_H_
+#define MODULES_MODULES_H_
 
 #include <config.h>
 #include <glib.h>
@@ -34,4 +34,4 @@ void gjs_register_static_modules (void);
 
 G_END_DECLS
 
-#endif  /* __GJS_CONSOLE_H__ */
+#endif  // MODULES_MODULES_H_
diff --git a/modules/system.h b/modules/system.h
index 1344c128..ff8cdb78 100644
--- a/modules/system.h
+++ b/modules/system.h
@@ -22,8 +22,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_SYSTEM_H__
-#define __GJS_SYSTEM_H__
+#ifndef MODULES_SYSTEM_H_
+#define MODULES_SYSTEM_H_
 
 #include <config.h>
 #include <glib.h>
@@ -39,4 +39,4 @@ bool gjs_js_define_system_stuff(JSContext              *context,
 
 G_END_DECLS
 
-#endif  /* __GJS_SYSTEM_H__ */
+#endif  // MODULES_SYSTEM_H_
diff --git a/test/gjs-test-utils.h b/test/gjs-test-utils.h
index 669bcd8a..9c3d7554 100644
--- a/test/gjs-test-utils.h
+++ b/test/gjs-test-utils.h
@@ -23,8 +23,8 @@
  * Authored By: Sam Spilsbury <sam endlessm com>
  */
 
-#ifndef GJS_TEST_UTILS_H
-#define GJS_TEST_UTILS_H
+#ifndef TEST_GJS_TEST_UTILS_H_
+#define TEST_GJS_TEST_UTILS_H_
 
 #include "gjs/context.h"
 #include "gjs/jsapi-wrapper.h"
@@ -48,4 +48,4 @@ void gjs_test_add_tests_for_parse_call_args(void);
 
 void gjs_test_add_tests_for_rooting(void);
 
-#endif
+#endif  // TEST_GJS_TEST_UTILS_H_
diff --git a/util/error.h b/util/error.h
index 9f97eb5b..1eba4235 100644
--- a/util/error.h
+++ b/util/error.h
@@ -21,8 +21,12 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_UTIL_ERROR_H__
-#define __GJS_UTIL_ERROR_H__
+#ifndef GJS_UTIL_ERROR_H_
+#define GJS_UTIL_ERROR_H_
+
+#if !defined(INSIDE_GJS_H) && !defined(GJS_COMPILATION)
+#    error "Only <gjs/gjs.h> can be included directly."
+#endif
 
 #include <glib-object.h>
 
@@ -61,4 +65,4 @@ typedef enum {
 
 G_END_DECLS
 
-#endif  /* __GJS_UTIL_ERROR_H__ */
+#endif /* GJS_UTIL_ERROR_H_ */
diff --git a/util/glib.h b/util/glib.h
index 3334dfb1..7ad642ce 100644
--- a/util/glib.h
+++ b/util/glib.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_UTIL_GLIB_H__
-#define __GJS_UTIL_GLIB_H__
+#ifndef UTIL_GLIB_H_
+#define UTIL_GLIB_H_
 
 #include <glib.h>
 
@@ -33,4 +33,4 @@ char**   gjs_g_strv_concat           (char      ***strv_array,
 
 G_END_DECLS
 
-#endif  /* __GJS_UTIL_GLIB_H__ */
+#endif  // UTIL_GLIB_H_
diff --git a/util/log.h b/util/log.h
index 69da1428..fa4def51 100644
--- a/util/log.h
+++ b/util/log.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_UTIL_LOG_H__
-#define __GJS_UTIL_LOG_H__
+#ifndef UTIL_LOG_H_
+#define UTIL_LOG_H_
 
 #include <glib.h>
 
@@ -174,4 +174,4 @@ void gjs_debug(GjsDebugTopic topic,
 
 G_END_DECLS
 
-#endif  /* __GJS_UTIL_LOG_H__ */
+#endif  // UTIL_LOG_H_
diff --git a/util/misc.h b/util/misc.h
index 7963fbb9..a94ace46 100644
--- a/util/misc.h
+++ b/util/misc.h
@@ -21,8 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __GJS_UTIL_MISC_H__
-#define __GJS_UTIL_MISC_H__
+#ifndef UTIL_MISC_H_
+#define UTIL_MISC_H_
 
 #include <glib.h>
 
@@ -32,4 +32,4 @@ bool    gjs_environment_variable_is_set   (const char *env_variable_name);
 
 G_END_DECLS
 
-#endif  /* __GJS_UTIL_MISC_H__ */
+#endif  // UTIL_MISC_H_


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