[glib/no-more-regex] Deprecate boxed GTypes for GRegex types



commit baf8ef7ffa7267d87f67357f27e6dc8e151af343
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Dec 7 14:39:59 2020 +0000

    Deprecate boxed GTypes for GRegex types

 gobject/gboxed.c      | 3 +++
 gobject/glib-types.h  | 8 ++++++--
 gobject/tests/boxed.c | 4 ++++
 3 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/gobject/gboxed.c b/gobject/gboxed.c
index 194251383..8b022d090 100644
--- a/gobject/gboxed.c
+++ b/gobject/gboxed.c
@@ -147,8 +147,11 @@ G_DEFINE_BOXED_TYPE (GByteArray, g_byte_array, g_byte_array_ref, g_byte_array_un
 G_DEFINE_BOXED_TYPE (GBytes, g_bytes, g_bytes_ref, g_bytes_unref)
 G_DEFINE_BOXED_TYPE (GTree, g_tree, g_tree_ref, g_tree_unref)
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+/* GRegex API has been deprecated in 2.68 */
 G_DEFINE_BOXED_TYPE (GRegex, g_regex, g_regex_ref, g_regex_unref)
 G_DEFINE_BOXED_TYPE (GMatchInfo, g_match_info, g_match_info_ref, g_match_info_unref)
+G_GNUC_END_IGNORE_DEPRECATIONS
 
 #define g_variant_type_get_type g_variant_type_get_gtype
 G_DEFINE_BOXED_TYPE (GVariantType, g_variant_type, g_variant_type_copy, g_variant_type_free)
diff --git a/gobject/glib-types.h b/gobject/glib-types.h
index cdccdaab4..0f2d14f33 100644
--- a/gobject/glib-types.h
+++ b/gobject/glib-types.h
@@ -91,8 +91,10 @@ typedef gsize GType;
  * The #GType for a boxed type holding a #GRegex reference.
  *
  * Since: 2.14
+ *
+ * Deprecated: 2.68: Use a custom boxed type around PCRE 2 types instead
  */
-#define G_TYPE_REGEX (g_regex_get_type ())
+#define G_TYPE_REGEX (g_regex_get_type ()) GLIB_DEPRECATED_MACRO_IN_2_68
 
 /**
  * G_TYPE_MATCH_INFO:
@@ -100,8 +102,10 @@ typedef gsize GType;
  * The #GType for a boxed type holding a #GMatchInfo reference.
  *
  * Since: 2.30
+ *
+ * Deprecated: 2.68: Use a custom boxed type around PCRE 2 types instead
  */
-#define G_TYPE_MATCH_INFO (g_match_info_get_type ())
+#define G_TYPE_MATCH_INFO (g_match_info_get_type ()) GLIB_DEPRECATED_MACRO_IN_2_68
 
 /**
  * G_TYPE_ARRAY:
diff --git a/gobject/tests/boxed.c b/gobject/tests/boxed.c
index 0c8872a82..dbe7cefc8 100644
--- a/gobject/tests/boxed.c
+++ b/gobject/tests/boxed.c
@@ -271,6 +271,7 @@ test_boxed_ptrarray (void)
   g_value_unset (&value);
 }
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 static void
 test_boxed_regex (void)
 {
@@ -293,7 +294,9 @@ test_boxed_regex (void)
 
   g_value_unset (&value);
 }
+G_GNUC_END_IGNORE_DEPRECATIONS
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 static void
 test_boxed_matchinfo (void)
 {
@@ -320,6 +323,7 @@ test_boxed_matchinfo (void)
   g_value_unset (&value);
   g_regex_unref (r);
 }
+G_GNUC_END_IGNORE_DEPRECATIONS
 
 static void
 test_boxed_varianttype (void)


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