[glib] Do not expand autoptr macros when running introspection



commit a07b57887dee43ca0e3cd33c319eaad8998e03fd
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Dec 22 15:03:07 2017 +0000

    Do not expand autoptr macros when running introspection
    
    The introspection scanner chokes fairly badly on the types we create,
    and that got even worse when the autolist support landed. Now, every
    time we declare a new GObject type we automatically get incomplete
    aliases to container types that gobject-introspection and Vala do not
    know how to handle.
    
    Since the autoptr machinery is not really introspectable to begin with,
    as it's a C utility extension that depends on the C compiler being used
    to compile a C project that depends on GLib, we can mark the whole
    section as non-introspectable using the __GI_SCANNER__ pre-processor
    symbol.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791342

 glib/gmacros.h |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/glib/gmacros.h b/glib/gmacros.h
index 3533677..430a3fb 100644
--- a/glib/gmacros.h
+++ b/glib/gmacros.h
@@ -433,6 +433,8 @@
 #define GLIB_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min) _GLIB_EXTERN
 #endif
 
+#ifndef __GI_SCANNER__
+
 #ifdef __GNUC__
 
 /* these macros are private */
@@ -484,6 +486,16 @@
 #define G_DEFINE_AUTO_CLEANUP_FREE_FUNC(TypeName, func, none)
 
 /* no declaration of g_auto() or g_autoptr() here */
-#endif
+#endif /* __GNUC__ */
+
+#else
+
+#define _GLIB_DEFINE_AUTOPTR_CHAINUP(ModuleObjName, ParentName)
+
+#define G_DEFINE_AUTOPTR_CLEANUP_FUNC(TypeName, func)
+#define G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(TypeName, func)
+#define G_DEFINE_AUTO_CLEANUP_FREE_FUNC(TypeName, func, none)
+
+#endif /* __GI_SCANNER__ */
 
 #endif /* __G_MACROS_H__ */


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