[glib/no-more-regex: 1196/1196] Deprecate boxed GTypes for GRegex types
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/no-more-regex: 1196/1196] Deprecate boxed GTypes for GRegex types
- Date: Fri, 27 Aug 2021 14:33:22 +0000 (UTC)
commit 62bbcea57945c0835018a37d9767b763ab8794be
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 c1624a598..e4b1cf07e 100644
--- a/gobject/gboxed.c
+++ b/gobject/gboxed.c
@@ -148,8 +148,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 808284622..370c01467 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 f961a2f87..cdc116e42 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]