summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2020-12-07 14:39:59 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2021-08-27 15:33:09 +0100
commit62bbcea57945c0835018a37d9767b763ab8794be (patch)
tree7264cdff81a28a6bd7b773daabec5eb134db419f
parentde32e1027d71c539b4ed5bc264185ba641c41ea6 (diff)
downloadglib-no-more-regex.tar.gz
Deprecate boxed GTypes for GRegex typesno-more-regex
-rw-r--r--gobject/gboxed.c3
-rw-r--r--gobject/glib-types.h8
-rw-r--r--gobject/tests/boxed.c4
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)