Add G_GNUC_BEGIN/END_IGNORE_DEPRECATIONS

Add new macros to disable -Wdeprecated-declarations around a piece of
code, using the C99 (and GNU89) _Pragma() operator. Replace the
existing use of #pragma for this in gio, and suppress the warnings in
gvaluearray.c as well.

https://bugzilla.gnome.org/show_bug.cgi?id=669671
This commit is contained in:
Dan Winship
2012-02-10 08:49:17 -05:00
parent ab59739e11
commit ca05902a58
6 changed files with 56 additions and 6 deletions

View File

@@ -809,8 +809,6 @@ DllMain (HINSTANCE hinstDLL,
#endif
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
void
_g_io_modules_ensure_extension_points_registered (void)
{
@@ -826,7 +824,9 @@ _g_io_modules_ensure_extension_points_registered (void)
#ifdef G_OS_UNIX
#if !GLIB_CHECK_VERSION (3, 0, 0)
ep = g_io_extension_point_register (G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_io_extension_point_set_required_type (ep, G_TYPE_DESKTOP_APP_INFO_LOOKUP);
G_GNUC_END_IGNORE_DEPRECATIONS
#endif
#endif
@@ -863,7 +863,6 @@ _g_io_modules_ensure_extension_points_registered (void)
G_UNLOCK (registered_extensions);
}
#pragma GCC diagnostic pop
void
_g_io_modules_ensure_loaded (void)