diff --git a/girepository/gdump.c b/girepository/gdump.c index caf2973bb..29bcfb676 100644 --- a/girepository/gdump.c +++ b/girepository/gdump.c @@ -32,7 +32,7 @@ * to libgirepository; see * https://bugzilla.gnome.org/show_bug.cgi?id=630342 */ -#ifdef G_IREPOSITORY_COMPILATION +#ifdef GI_COMPILATION #include "config.h" #include "girepository.h" #endif @@ -543,7 +543,7 @@ dump_error_quark (GQuark quark, const char *symbol, GOutputStream *out) * * Returns: %TRUE on success, %FALSE on error */ -#ifndef G_IREPOSITORY_COMPILATION +#ifndef GI_COMPILATION static gboolean dump_irepository (const char *arg, GError **error) G_GNUC_UNUSED; static gboolean diff --git a/girepository/girepository.h b/girepository/girepository.h index 511ef30eb..1bac63ffc 100644 --- a/girepository/girepository.h +++ b/girepository/girepository.h @@ -247,4 +247,6 @@ void gi_cclosure_marshal_generic (GClosure *closure, G_END_DECLS +#undef __GIREPOSITORY_H_INSIDE__ + #endif /* __G_IREPOSITORY_H__ */ diff --git a/girepository/girffi.h b/girepository/girffi.h index 28de33b19..359a5d36a 100644 --- a/girepository/girffi.h +++ b/girepository/girffi.h @@ -24,6 +24,10 @@ #ifndef __GIRFFI_H__ #define __GIRFFI_H__ +#if !defined (__GIREPOSITORY_H_INSIDE__) && !defined (GI_COMPILATION) +#error "Only can be included directly." +#endif + #include #include "girepository.h" diff --git a/girepository/meson.build b/girepository/meson.build index 477994c65..9e3a3275d 100644 --- a/girepository/meson.build +++ b/girepository/meson.build @@ -67,7 +67,7 @@ girepo_headers = files( install_headers(girepo_headers, install_dir: gir_includedir) gir_c_args = [ - '-DG_IREPOSITORY_COMPILATION', + '-DGI_COMPILATION', '-DG_LOG_DOMAIN="GLib-GIRepository"', '-DGIR_SUFFIX="gir-1.0"', '-DGIR_DIR="@0@"'.format(glib_girdir),