diff --git a/gio/giomodule.c b/gio/giomodule.c index ee1b0b6f4..9bb28985a 100644 --- a/gio/giomodule.c +++ b/gio/giomodule.c @@ -20,6 +20,10 @@ #include "config.h" +/* For the #GDesktopAppInfoLookup macros; since macro deprecation is implemented + * in the preprocessor, we need to define this before including glib.h*/ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #include #include "giomodule.h" @@ -1087,9 +1091,7 @@ _g_io_modules_ensure_extension_points_registered (void) #if defined(G_OS_UNIX) && !defined(HAVE_COCOA) #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 diff --git a/glib/deprecated/gcache.c b/glib/deprecated/gcache.c index 7056c13ac..179ad9e17 100644 --- a/glib/deprecated/gcache.c +++ b/glib/deprecated/gcache.c @@ -28,6 +28,9 @@ #include "config.h" +/* we know we are deprecated here, no need for warnings */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #include "gcache.h" #include "gslice.h" diff --git a/tests/asyncqueue-test.c b/tests/asyncqueue-test.c index 0cf67b21b..2dd8563c7 100644 --- a/tests/asyncqueue-test.c +++ b/tests/asyncqueue-test.c @@ -1,6 +1,5 @@ #undef G_DISABLE_ASSERT #undef G_LOG_DOMAIN -#undef G_DISABLE_DEPRECATED #include #include diff --git a/tests/testglib.c b/tests/testglib.c index 687fadd5b..372ddae2c 100644 --- a/tests/testglib.c +++ b/tests/testglib.c @@ -1169,10 +1169,11 @@ hash_table_tests (void) g_hash_table_destroy (hash_table); } -#ifndef G_DISABLE_DEPRECATED static void relation_test (void) { + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + GRelation *relation = g_relation_new (2); GTuples *tuples; gint data [1024]; @@ -1241,8 +1242,9 @@ relation_test (void) g_relation_destroy (relation); relation = NULL; + + G_GNUC_END_IGNORE_DEPRECATIONS } -#endif static void gstring_tests (void) @@ -1637,10 +1639,11 @@ various_string_tests (void) /* g_debug (argv[0]); */ } -#ifndef G_DISABLE_DEPRECATED static void test_mem_chunks (void) { + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + GMemChunk *mem_chunk = g_mem_chunk_new ("test mem chunk", 50, 100, G_ALLOC_AND_FREE); gchar *mem[10000]; guint i; @@ -1655,8 +1658,9 @@ test_mem_chunks (void) g_mem_chunk_free (mem_chunk, mem[i]); g_mem_chunk_destroy (mem_chunk); + + G_GNUC_END_IGNORE_DEPRECATIONS } -#endif int main (int argc, @@ -1674,15 +1678,11 @@ main (int argc, g_test_add_func ("/testglib/GTree", binary_tree_test); g_test_add_func ("/testglib/Arrays", test_arrays); g_test_add_func ("/testglib/GHashTable", hash_table_tests); -#ifndef G_DISABLE_DEPRECATED g_test_add_func ("/testglib/Relation (deprecated)", relation_test); -#endif g_test_add_func ("/testglib/File Paths", test_paths); g_test_add_func ("/testglib/File Functions", test_file_functions); g_test_add_func ("/testglib/Parse Debug Strings", test_g_parse_debug_string); -#ifndef G_DISABLE_DEPRECATED g_test_add_func ("/testglib/GMemChunk (deprecated)", test_mem_chunks); -#endif g_test_add_func ("/testglib/Warnings & Errors", log_warning_error_tests); g_test_add_func ("/testglib/Timers (slow)", timer_tests);