From b5e1ea6fee6ac5b97585ffc1e30eb4f1ec137e1f Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Fri, 30 Jan 2015 16:40:03 +0100 Subject: [PATCH] DECLARE_TYPE: ignore deprecations in inlines Prevent complaints about deprecations in the inline functions emitted by the new G_DECLARE_*_TYPE macros. --- gobject/gtype.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gobject/gtype.h b/gobject/gtype.h index d055a96f0..e6fbaf3e6 100644 --- a/gobject/gtype.h +++ b/gobject/gtype.h @@ -1383,6 +1383,7 @@ guint g_type_get_type_registration_serial (void); **/ #define G_DECLARE_FINAL_TYPE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, ParentName) \ GType module_obj_name##_get_type (void); \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ typedef struct _##ModuleObjName ModuleObjName; \ typedef struct { ParentName##Class parent_class; } ModuleObjName##Class; \ \ @@ -1390,6 +1391,7 @@ guint g_type_get_type_registration_serial (void); return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \ static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) { \ return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); } \ + G_GNUC_END_IGNORE_DEPRECATIONS /** * G_DECLARE_DERIVABLE_TYPE: @@ -1464,6 +1466,7 @@ guint g_type_get_type_registration_serial (void); **/ #define G_DECLARE_DERIVABLE_TYPE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, ParentName) \ GType module_obj_name##_get_type (void); \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ typedef struct _##ModuleObjName ModuleObjName; \ typedef struct _##ModuleObjName##Class ModuleObjName##Class; \ struct _##ModuleObjName { ParentName parent_instance; }; \ @@ -1478,6 +1481,7 @@ guint g_type_get_type_registration_serial (void); return G_TYPE_CHECK_CLASS_TYPE (ptr, module_obj_name##_get_type ()); } \ static inline ModuleObjName##Class * MODULE##_##OBJ_NAME##_GET_CLASS (gpointer ptr) { \ return G_TYPE_INSTANCE_GET_CLASS (ptr, module_obj_name##_get_type (), ModuleObjName##Class); } + G_GNUC_END_IGNORE_DEPRECATIONS /** * G_DEFINE_TYPE: