[glib] gtype.h: Fix Build on non-GCC



commit 6161b285da3d00fb4e02d4774d741799b6e18584
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Feb 2 23:25:31 2015 +0800

    gtype.h: Fix Build on non-GCC
    
    Use the (private) _GLIB_DEFINE_AUTOPTR_CHAINUP macro for
    G_DECLARE_DERIVABLE_TYPE and G_DECLARE_FINAL_TYPE so that we will
    attempt to typedef and define items necessary for GCC
    __attribute__((cleanup)) on, well, GCC only.
    
    This fixes the build on non-GCC.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=743640

 gobject/gtype.h |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gobject/gtype.h b/gobject/gtype.h
index 8df1f0a..76c1c7b 100644
--- a/gobject/gtype.h
+++ b/gobject/gtype.h
@@ -1391,9 +1391,7 @@ guint     g_type_get_type_registration_serial (void);
   typedef struct _##ModuleObjName ModuleObjName;                                                         \
   typedef struct { ParentName##Class parent_class; } ModuleObjName##Class;                               \
                                                                                                          \
-  typedef ModuleObjName *_GLIB_AUTOPTR_TYPENAME(ModuleObjName);                                          \
-  static inline void _GLIB_AUTOPTR_FUNC_NAME(ModuleObjName) (ModuleObjName **_ptr) {                     \
-    _GLIB_AUTOPTR_FUNC_NAME(ParentName) ((ParentName **) _ptr); }                                        \
+  _GLIB_DEFINE_AUTOPTR_CHAINUP (ModuleObjName, ParentName)                                               \
                                                                                                          \
   static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) {                                     \
     return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); }             \
@@ -1483,9 +1481,7 @@ guint     g_type_get_type_registration_serial (void);
   typedef struct _##ModuleObjName##Class ModuleObjName##Class;                                           \
   struct _##ModuleObjName { ParentName parent_instance; };                                               \
                                                                                                          \
-  typedef ModuleObjName *_GLIB_AUTOPTR_TYPENAME(ModuleObjName);                                          \
-  static inline void _GLIB_AUTOPTR_FUNC_NAME(ModuleObjName) (ModuleObjName **_ptr) {                     \
-    _GLIB_AUTOPTR_FUNC_NAME(ParentName) ((ParentName **) _ptr); }                                        \
+  _GLIB_DEFINE_AUTOPTR_CHAINUP (ModuleObjName, ParentName)                                               \
                                                                                                          \
   static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) {                                     \
     return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); }             \


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