[glib/wip/gproperty-2: 43/57] Deprecate g_type_class_add_private()



commit c44fdf47f6aabfafcc039fdc2a7ee4b4fdc28de3
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Jun 10 22:23:51 2013 +0100

    Deprecate g_type_class_add_private()
    
    We have a new set of macros for adding private data structures to
    instances of a new type.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700035

 gobject/gtype.c         |    4 ++++
 gobject/gtype.h         |    2 +-
 gobject/tests/private.c |    2 ++
 3 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gobject/gtype.c b/gobject/gtype.c
index 23f503d..99d7426 100644
--- a/gobject/gtype.c
+++ b/gobject/gtype.c
@@ -4473,6 +4473,10 @@ gobject_init_ctor (void)
  * ]|
  *
  * Since: 2.4
+ *
+ * Deprecated: 2.38: Use the G_ADD_PRIVATE() macro when defining the type using
+ *   the G_DEFINE_TYPE_WITH_CODE() macro, or use G_DEFINE_TYPE_WITH_PRIVATE()
+ *   instead.
  */
 void
 g_type_class_add_private (gpointer g_class,
diff --git a/gobject/gtype.h b/gobject/gtype.h
index b0a4fba..2827896 100644
--- a/gobject/gtype.h
+++ b/gobject/gtype.h
@@ -1281,7 +1281,7 @@ void  g_type_interface_add_prerequisite (GType                         interface_type,
 GLIB_AVAILABLE_IN_ALL
 GType*g_type_interface_prerequisites    (GType                       interface_type,
                                         guint                      *n_prerequisites);
-GLIB_AVAILABLE_IN_ALL
+GLIB_DEPRECATED_IN_2_38_FOR (Use the G_ADD_PRIVATE macro instead)
 void     g_type_class_add_private       (gpointer                    g_class,
                                          gsize                       private_size);
 GLIB_AVAILABLE_IN_2_38
diff --git a/gobject/tests/private.c b/gobject/tests/private.c
index 80ef9fc..e7b19ac 100644
--- a/gobject/tests/private.c
+++ b/gobject/tests/private.c
@@ -125,11 +125,13 @@ GType test_mixed_get_type (void);
 
 G_DEFINE_TYPE (TestMixed, test_mixed, test_object_get_type ())
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 static void
 test_mixed_class_init (TestMixedClass *klass)
 {
   g_type_class_add_private (klass, sizeof (TestMixedPrivate));
 }
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 
 static void
 test_mixed_init (TestMixed *self)


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