From 6161b285da3d00fb4e02d4774d741799b6e18584 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 2 Feb 2015 23:25:31 +0800 Subject: [PATCH] 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 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gobject/gtype.h b/gobject/gtype.h index 8df1f0a16..76c1c7bdd 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); } \