diff options
author | Philip Withnall <withnall@endlessm.com> | 2019-10-23 11:25:48 +0100 |
---|---|---|
committer | Philip Withnall <withnall@endlessm.com> | 2019-10-23 11:25:48 +0100 |
commit | 65ce1c3fcd7f1151aeba0b43715564e30b7d471c (patch) | |
tree | 007bcfe7e48b2f8347db9e92b40a6521f2111245 | |
parent | c7dd1ae04055001ad48cb9da371fa8131118f3b3 (diff) | |
download | glib-65ce1c3fcd7f1151aeba0b43715564e30b7d471c.tar.gz |
glib: Ignore deprecations when declaring autocleanups
We may need to declare autocleanups for new types, which will be marked
as ‘deprecated’ if the code which includes GLib doesn’t declare a high
enough `GLIB_VERSION_MAX_ALLOWED`. Despite that, we still need to
declare the autocleanups.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
-rw-r--r-- | glib/glib-autocleanups.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/glib/glib-autocleanups.h b/glib/glib-autocleanups.h index efa4a99ab..91b4be566 100644 --- a/glib/glib-autocleanups.h +++ b/glib/glib-autocleanups.h @@ -35,6 +35,10 @@ g_autoptr_cleanup_gstring_free (GString *string) g_string_free (string, TRUE); } +/* Ignore deprecations in case we refer to a type which was added in a more + * recent GLib version than the user’s #GLIB_VERSION_MAX_ALLOWED definition. */ +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + /* If adding a cleanup here, please also add a test case to * glib/tests/autoptr.c */ @@ -91,3 +95,5 @@ G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GVariantDict, g_variant_dict_clear) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantType, g_variant_type_free) G_DEFINE_AUTO_CLEANUP_FREE_FUNC(GStrv, g_strfreev, NULL) G_DEFINE_AUTOPTR_CLEANUP_FUNC (GRefString, g_ref_string_release) + +G_GNUC_END_IGNORE_DEPRECATIONS |