From 9bfd7e2a9d2dc52ad545e0e138d4547be43a7a0d Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 May 2019 18:09:08 +0100 Subject: [PATCH 01/14] gdesktopappinfo: Add deprecation version to GDesktopAppInfoLookup Signed-off-by: Philip Withnall --- gio/gdesktopappinfo.c | 6 +++++- gio/gdesktopappinfo.h | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index 77e385aa5a..28ef7ec177 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -4555,6 +4555,9 @@ g_app_info_get_all (void) * * #GDesktopAppInfoLookup is an opaque data structure and can only be accessed * using the following functions. + * + * Deprecated: 2.28: The #GDesktopAppInfoLookup interface is deprecated and + * unused by GIO. **/ G_GNUC_BEGIN_IGNORE_DEPRECATIONS @@ -4585,7 +4588,8 @@ g_desktop_app_info_lookup_default_init (GDesktopAppInfoLookupInterface *iface) * * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error. * - * Deprecated: The #GDesktopAppInfoLookup interface is deprecated and unused by gio. + * Deprecated: 2.28: The #GDesktopAppInfoLookup interface is deprecated and + * unused by GIO. */ GAppInfo * g_desktop_app_info_lookup_get_default_for_uri_scheme (GDesktopAppInfoLookup *lookup, diff --git a/gio/gdesktopappinfo.h b/gio/gdesktopappinfo.h index 1254038a48..3ba5e2226a 100644 --- a/gio/gdesktopappinfo.h +++ b/gio/gdesktopappinfo.h @@ -118,6 +118,9 @@ gchar * g_desktop_app_info_get_action_name (GDeskto * * Extension point for default handler to URI association. See * [Extending GIO][extending-gio]. + * + * Deprecated: 2.28: The #GDesktopAppInfoLookup interface is deprecated and + * unused by GIO. */ #define G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME "gio-desktop-app-info-lookup" -- GitLab From 70c8a7ef8dc878e25bc1570ecacfa37ead8afda1 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 May 2019 18:09:35 +0100 Subject: [PATCH 02/14] gdesktopappinfo: Improve documentation formatting slightly Signed-off-by: Philip Withnall --- gio/gdesktopappinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index 28ef7ec177..ba2469af85 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -4578,10 +4578,10 @@ g_desktop_app_info_lookup_default_init (GDesktopAppInfoLookupInterface *iface) * @uri_scheme: a string containing a URI scheme. * * Gets the default application for launching applications - * using this URI scheme for a particular GDesktopAppInfoLookup + * using this URI scheme for a particular #GDesktopAppInfoLookup * implementation. * - * The GDesktopAppInfoLookup interface and this function is used + * The #GDesktopAppInfoLookup interface and this function is used * to implement g_app_info_get_default_for_uri_scheme() backends * in a GIO module. There is no reason for applications to use it * directly. Applications should use g_app_info_get_default_for_uri_scheme(). -- GitLab From 5ad9d3fd6190fd4d27c42051e1cbb4eb62da25f2 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 May 2019 18:11:35 +0100 Subject: [PATCH 03/14] glib: Move some documentation comments to where the symbols are defined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes it easier to maintain the documentation and code at the same time. The documentation comments haven’t been modified. Signed-off-by: Philip Withnall --- glib/docs.c | 34 ---------------------------------- glib/gmacros.h | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/glib/docs.c b/glib/docs.c index f68a1a8b73..60ca64c3cc 100644 --- a/glib/docs.c +++ b/glib/docs.c @@ -1819,22 +1819,6 @@ * Returns: the offset of @member from the start of @struct_type */ -/** - * G_CONST_RETURN: - * - * If %G_DISABLE_CONST_RETURNS is defined, this macro expands - * to nothing. By default, the macro expands to const. The macro - * can be used in place of const for functions that return a value - * that should not be modified. The purpose of this macro is to allow - * us to turn on const for returned constant strings by default, while - * allowing programmers who find that annoying to turn it off. This macro - * should only be used for return values and for "out" parameters, it - * doesn't make sense for "in" parameters. - * - * Deprecated: 2.30: API providers should replace all existing uses with - * const and API consumers should adjust their code accordingly - */ - /** * G_N_ELEMENTS: * @arr: the array @@ -2139,24 +2123,6 @@ * of deprecated GLib APIs. */ -/** - * G_GNUC_FUNCTION: - * - * Expands to "" on all modern compilers, and to __FUNCTION__ on gcc - * version 2.x. Don't use it. - * - * Deprecated: 2.16: Use G_STRFUNC() instead - */ - -/** - * G_GNUC_PRETTY_FUNCTION: - * - * Expands to "" on all modern compilers, and to __PRETTY_FUNCTION__ - * on gcc version 2.x. Don't use it. - * - * Deprecated: 2.16: Use G_STRFUNC() instead - */ - /** * G_GNUC_INTERNAL: * diff --git a/glib/gmacros.h b/glib/gmacros.h index db5f0b0874..63cefe38ef 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -689,6 +689,24 @@ #define G_GNUC_WARN_UNUSED_RESULT #endif /* __GNUC__ */ +/** + * G_GNUC_FUNCTION: + * + * Expands to "" on all modern compilers, and to __FUNCTION__ on gcc + * version 2.x. Don't use it. + * + * Deprecated: 2.16: Use G_STRFUNC() instead + */ + +/** + * G_GNUC_PRETTY_FUNCTION: + * + * Expands to "" on all modern compilers, and to __PRETTY_FUNCTION__ + * on gcc version 2.x. Don't use it. + * + * Deprecated: 2.16: Use G_STRFUNC() instead + */ + #ifndef G_DISABLE_DEPRECATED /* Wrap the gcc __PRETTY_FUNCTION__ and __FUNCTION__ variables with * macros, so we can refer to them as strings unconditionally. @@ -867,6 +885,22 @@ #define G_ALIGNOF(type) (G_STRUCT_OFFSET (struct { char a; type b; }, b)) #endif +/** + * G_CONST_RETURN: + * + * If %G_DISABLE_CONST_RETURNS is defined, this macro expands + * to nothing. By default, the macro expands to const. The macro + * can be used in place of const for functions that return a value + * that should not be modified. The purpose of this macro is to allow + * us to turn on const for returned constant strings by default, while + * allowing programmers who find that annoying to turn it off. This macro + * should only be used for return values and for "out" parameters, it + * doesn't make sense for "in" parameters. + * + * Deprecated: 2.30: API providers should replace all existing uses with + * const and API consumers should adjust their code accordingly + */ + /* Deprecated -- do not use. */ #ifndef G_DISABLE_DEPRECATED #ifdef G_DISABLE_CONST_RETURNS -- GitLab From 52b38ba6da3351a857080456563117b1d86b9901 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 May 2019 19:32:14 +0100 Subject: [PATCH 04/14] =?UTF-8?q?tests:=20Don=E2=80=99t=20use=20a=20deprec?= =?UTF-8?q?ated=20Unicode=20character=20type=20enumerator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Philip Withnall --- glib/tests/unicode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/tests/unicode.c b/glib/tests/unicode.c index 3858b77327..50c94edbec 100644 --- a/glib/tests/unicode.c +++ b/glib/tests/unicode.c @@ -64,7 +64,7 @@ test_unichar_character_type (void) { G_UNICODE_OTHER_LETTER, 0x3400 }, { G_UNICODE_TITLECASE_LETTER, 0x01C5 }, { G_UNICODE_UPPERCASE_LETTER, 0xFF21 }, - { G_UNICODE_COMBINING_MARK, 0x0903 }, + { G_UNICODE_SPACING_MARK, 0x0903 }, { G_UNICODE_ENCLOSING_MARK, 0x20DD }, { G_UNICODE_NON_SPACING_MARK, 0xA806 }, { G_UNICODE_DECIMAL_NUMBER, 0xFF10 }, -- GitLab From 05f7ea9fc5a2da30862d6bf70f1d519f0059634c Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 May 2019 19:33:26 +0100 Subject: [PATCH 05/14] gtimezone: Stop using deprecated API Signed-off-by: Philip Withnall --- glib/gtimezone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/gtimezone.c b/glib/gtimezone.c index f418401eed..970b4b1a51 100644 --- a/glib/gtimezone.c +++ b/glib/gtimezone.c @@ -850,7 +850,7 @@ find_relative_date (TimeZoneDate *buffer) else /* M.W.D */ { guint days; - guint days_in_month = g_date_days_in_month (buffer->mon, buffer->year); + guint days_in_month = g_date_get_days_in_month (buffer->mon, buffer->year); GDateWeekday first_wday; g_date_set_dmy (&date, 1, buffer->mon, buffer->year); -- GitLab From db270e3c2d656e5e30b14aec76d5cf6112de21e1 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 May 2019 18:21:50 +0100 Subject: [PATCH 06/14] gmacros: Add GLIB_DEPRECATED_{MACRO,ENUMERATOR,TYPE}{,_FOR} These will be used to annotate deprecated macros, types and enumerators. `GLIB_DEPRECATED_MACRO{,_FOR}` are based very heavily on the corresponding macros from Clutter, written by Emmanuele Bassi. The other deprecation annotators use the standard annotations supported by Clang and GCC. They need to be separated as they are supported in different versions of the compilers. Signed-off-by: Philip Withnall Fixes: #1060 --- glib/gmacros.h | 39 ++++- glib/gversionmacros.h | 338 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 376 insertions(+), 1 deletion(-) diff --git a/glib/gmacros.h b/glib/gmacros.h index 63cefe38ef..8a311d1384 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -963,7 +963,7 @@ #define _GLIB_EXTERN extern #endif -/* These macros are used to mark deprecated functions in GLib headers, +/* These macros are used to mark deprecated symbols in GLib headers, * and thus have to be exposed in installed headers. But please * do *not* use them in other projects. Instead, use G_DEPRECATED * or define your own wrappers around it. @@ -979,6 +979,43 @@ #define GLIB_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min) _GLIB_EXTERN #endif +#if !defined(GLIB_DISABLE_DEPRECATION_WARNINGS) && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || \ + __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4)) +#define _GLIB_GNUC_DO_PRAGMA(x) _Pragma(G_STRINGIFY (x)) +#define GLIB_DEPRECATED_MACRO _GLIB_GNUC_DO_PRAGMA(GCC warning "Deprecated pre-processor symbol") +#define GLIB_DEPRECATED_MACRO_FOR(f) _GLIB_GNUC_DO_PRAGMA(GCC warning #f) +#define GLIB_UNAVAILABLE_MACRO(maj,min) _GLIB_GNUC_DO_PRAGMA(GCC warning "Not available before " #maj "." #min) +#else +#define GLIB_DEPRECATED_MACRO +#define GLIB_DEPRECATED_MACRO_FOR(f) +#define GLIB_UNAVAILABLE_MACRO(maj,min) +#endif + +#if !defined(GLIB_DISABLE_DEPRECATION_WARNINGS) && \ + (__GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ >= 2) || \ + __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 0)) +#define GLIB_DEPRECATED_ENUMERATOR G_DEPRECATED +#define GLIB_DEPRECATED_ENUMERATOR_FOR(f) G_DEPRECATED_FOR(f) +#define GLIB_UNAVAILABLE_ENUMERATOR(maj,min) G_UNAVAILABLE(maj,min) +#else +#define GLIB_DEPRECATED_ENUMERATOR +#define GLIB_DEPRECATED_ENUMERATOR_FOR(f) +#define GLIB_UNAVAILABLE_ENUMERATOR(maj,min) +#endif + +#if !defined(GLIB_DISABLE_DEPRECATION_WARNINGS) && \ + (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || \ + __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 0)) +#define GLIB_DEPRECATED_TYPE G_DEPRECATED +#define GLIB_DEPRECATED_TYPE_FOR(f) G_DEPRECATED_FOR(f) +#define GLIB_UNAVAILABLE_TYPE(maj,min) G_UNAVAILABLE(maj,min) +#else +#define GLIB_DEPRECATED_TYPE +#define GLIB_DEPRECATED_TYPE_FOR(f) +#define GLIB_UNAVAILABLE_TYPE(maj,min) +#endif + #ifndef __GI_SCANNER__ #ifdef __GNUC__ diff --git a/glib/gversionmacros.h b/glib/gversionmacros.h index e66afdd913..ee91f6d5b2 100644 --- a/glib/gversionmacros.h +++ b/glib/gversionmacros.h @@ -319,267 +319,605 @@ #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_26 # define GLIB_DEPRECATED_IN_2_26 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_26_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_26 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_26_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_26 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_26_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_26 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_26_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_26 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_26_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_26 +# define GLIB_DEPRECATED_MACRO_IN_2_26_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_26 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_26_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_26 +# define GLIB_DEPRECATED_TYPE_IN_2_26_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_26 # define GLIB_AVAILABLE_IN_2_26 GLIB_UNAVAILABLE(2, 26) +# define GLIB_AVAILABLE_MACRO_IN_2_26 GLIB_UNAVAILABLE_MACRO(2, 26) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_26 GLIB_UNAVAILABLE_ENUMERATOR(2, 26) +# define GLIB_AVAILABLE_TYPE_IN_2_26 GLIB_UNAVAILABLE_TYPE(2, 26) #else # define GLIB_AVAILABLE_IN_2_26 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_26 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_26 +# define GLIB_AVAILABLE_TYPE_IN_2_26 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_28 # define GLIB_DEPRECATED_IN_2_28 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_28_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_28 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_28_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_28 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_28_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_28 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_28_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_28 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_28_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_28 +# define GLIB_DEPRECATED_MACRO_IN_2_28_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_28 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_28_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_28 +# define GLIB_DEPRECATED_TYPE_IN_2_28_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_28 # define GLIB_AVAILABLE_IN_2_28 GLIB_UNAVAILABLE(2, 28) +# define GLIB_AVAILABLE_MACRO_IN_2_28 GLIB_UNAVAILABLE_MACRO(2, 28) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_28 GLIB_UNAVAILABLE_ENUMERATOR(2, 28) +# define GLIB_AVAILABLE_TYPE_IN_2_28 GLIB_UNAVAILABLE_TYPE(2, 28) #else # define GLIB_AVAILABLE_IN_2_28 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_28 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_28 +# define GLIB_AVAILABLE_TYPE_IN_2_28 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_30 # define GLIB_DEPRECATED_IN_2_30 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_30_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_30 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_30_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_30 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_30_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_30 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_30_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_30 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_30_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_30 +# define GLIB_DEPRECATED_MACRO_IN_2_30_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_30 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_30_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_30 +# define GLIB_DEPRECATED_TYPE_IN_2_30_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_30 # define GLIB_AVAILABLE_IN_2_30 GLIB_UNAVAILABLE(2, 30) +# define GLIB_AVAILABLE_MACRO_IN_2_30 GLIB_UNAVAILABLE_MACRO(2, 30) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_30 GLIB_UNAVAILABLE_ENUMERATOR(2, 30) +# define GLIB_AVAILABLE_TYPE_IN_2_30 GLIB_UNAVAILABLE_TYPE(2, 30) #else # define GLIB_AVAILABLE_IN_2_30 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_30 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_30 +# define GLIB_AVAILABLE_TYPE_IN_2_30 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_32 # define GLIB_DEPRECATED_IN_2_32 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_32_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_32 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_32_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_32 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_32_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_32 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_32_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_32 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_32_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_32 +# define GLIB_DEPRECATED_MACRO_IN_2_32_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_32 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_32_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_32 +# define GLIB_DEPRECATED_TYPE_IN_2_32_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_32 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_32_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_32 +# define GLIB_DEPRECATED_TYPE_IN_2_32_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_32 # define GLIB_AVAILABLE_IN_2_32 GLIB_UNAVAILABLE(2, 32) +# define GLIB_AVAILABLE_MACRO_IN_2_32 GLIB_UNAVAILABLE_MACRO(2, 32) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_32 GLIB_UNAVAILABLE_ENUMERATOR(2, 32) +# define GLIB_AVAILABLE_TYPE_IN_2_32 GLIB_UNAVAILABLE_TYPE(2, 32) #else # define GLIB_AVAILABLE_IN_2_32 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_32 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_32 +# define GLIB_AVAILABLE_TYPE_IN_2_32 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_34 # define GLIB_DEPRECATED_IN_2_34 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_34_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_34 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_34_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_34 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_34_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_34 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_34_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_34 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_34_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_34 +# define GLIB_DEPRECATED_MACRO_IN_2_34_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_34 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_34_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_34 +# define GLIB_DEPRECATED_TYPE_IN_2_34_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_34 # define GLIB_AVAILABLE_IN_2_34 GLIB_UNAVAILABLE(2, 34) +# define GLIB_AVAILABLE_MACRO_IN_2_34 GLIB_UNAVAILABLE_MACRO(2, 34) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_34 GLIB_UNAVAILABLE_ENUMERATOR(2, 34) +# define GLIB_AVAILABLE_TYPE_IN_2_34 GLIB_UNAVAILABLE_TYPE(2, 34) #else # define GLIB_AVAILABLE_IN_2_34 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_34 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_34 +# define GLIB_AVAILABLE_TYPE_IN_2_34 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_36 # define GLIB_DEPRECATED_IN_2_36 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_36_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_36 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_36_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_36 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_36_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_36 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_36_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_36 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_36_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_36 +# define GLIB_DEPRECATED_MACRO_IN_2_36_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_36 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_36_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_36 +# define GLIB_DEPRECATED_TYPE_IN_2_36_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_36 # define GLIB_AVAILABLE_IN_2_36 GLIB_UNAVAILABLE(2, 36) +# define GLIB_AVAILABLE_MACRO_IN_2_36 GLIB_UNAVAILABLE_MACRO(2, 36) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_36 GLIB_UNAVAILABLE_ENUMERATOR(2, 36) +# define GLIB_AVAILABLE_TYPE_IN_2_36 GLIB_UNAVAILABLE_TYPE(2, 36) #else # define GLIB_AVAILABLE_IN_2_36 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_36 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_36 +# define GLIB_AVAILABLE_TYPE_IN_2_36 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_38 # define GLIB_DEPRECATED_IN_2_38 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_38_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_38 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_38_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_38 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_38_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_38 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_38_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_38 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_38_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_38 +# define GLIB_DEPRECATED_MACRO_IN_2_38_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_38 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_38_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_38 +# define GLIB_DEPRECATED_TYPE_IN_2_38_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38 # define GLIB_AVAILABLE_IN_2_38 GLIB_UNAVAILABLE(2, 38) +# define GLIB_AVAILABLE_MACRO_IN_2_38 GLIB_UNAVAILABLE_MACRO(2, 38) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_38 GLIB_UNAVAILABLE_ENUMERATOR(2, 38) +# define GLIB_AVAILABLE_TYPE_IN_2_38 GLIB_UNAVAILABLE_TYPE(2, 38) #else # define GLIB_AVAILABLE_IN_2_38 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_38 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_38 +# define GLIB_AVAILABLE_TYPE_IN_2_38 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_40 # define GLIB_DEPRECATED_IN_2_40 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_40_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_40 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_40_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_40 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_40_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_40 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_40_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_40 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_40_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_40 +# define GLIB_DEPRECATED_MACRO_IN_2_40_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_40 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_40_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_40 +# define GLIB_DEPRECATED_TYPE_IN_2_40_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_40 # define GLIB_AVAILABLE_IN_2_40 GLIB_UNAVAILABLE(2, 40) +# define GLIB_AVAILABLE_MACRO_IN_2_40 GLIB_UNAVAILABLE_MACRO(2, 40) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_40 GLIB_UNAVAILABLE_ENUMERATOR(2, 40) +# define GLIB_AVAILABLE_TYPE_IN_2_40 GLIB_UNAVAILABLE_TYPE(2, 40) #else # define GLIB_AVAILABLE_IN_2_40 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_40 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_40 +# define GLIB_AVAILABLE_TYPE_IN_2_40 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_42 # define GLIB_DEPRECATED_IN_2_42 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_42_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_42 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_42_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) #else # define GLIB_DEPRECATED_IN_2_42 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_42_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_42 +# define GLIB_DEPRECATED_MACRO_IN_2_42_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_42 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_42_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_42 +# define GLIB_DEPRECATED_TYPE_IN_2_42_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_42 # define GLIB_AVAILABLE_IN_2_42 GLIB_UNAVAILABLE(2, 42) +# define GLIB_AVAILABLE_MACRO_IN_2_42 GLIB_UNAVAILABLE_MACRO(2, 42) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_42 GLIB_UNAVAILABLE_ENUMERATOR(2, 42) +# define GLIB_AVAILABLE_TYPE_IN_2_42 GLIB_UNAVAILABLE_TYPE(2, 42) #else # define GLIB_AVAILABLE_IN_2_42 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_42 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_42 +# define GLIB_AVAILABLE_TYPE_IN_2_42 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_44 # define GLIB_DEPRECATED_IN_2_44 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_44_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_44 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_44_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_44 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_44_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_44 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_44_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_44 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_44_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_44 +# define GLIB_DEPRECATED_MACRO_IN_2_44_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_44 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_44_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_44 +# define GLIB_DEPRECATED_TYPE_IN_2_44_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_44 # define GLIB_AVAILABLE_IN_2_44 GLIB_UNAVAILABLE(2, 44) +# define GLIB_AVAILABLE_MACRO_IN_2_44 GLIB_UNAVAILABLE_MACRO(2, 44) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_44 GLIB_UNAVAILABLE_ENUMERATOR(2, 44) +# define GLIB_AVAILABLE_TYPE_IN_2_44 GLIB_UNAVAILABLE_TYPE(2, 44) #else # define GLIB_AVAILABLE_IN_2_44 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_44 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_44 +# define GLIB_AVAILABLE_TYPE_IN_2_44 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_46 # define GLIB_DEPRECATED_IN_2_46 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_46_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_46 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_46_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) #else # define GLIB_DEPRECATED_IN_2_46 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_46_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_46 +# define GLIB_DEPRECATED_MACRO_IN_2_46_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_46 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_46_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_46 +# define GLIB_DEPRECATED_TYPE_IN_2_46_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_46 # define GLIB_AVAILABLE_IN_2_46 GLIB_UNAVAILABLE(2, 46) +# define GLIB_AVAILABLE_MACRO_IN_2_46 GLIB_UNAVAILABLE_MACRO(2, 46) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_46 GLIB_UNAVAILABLE_ENUMERATOR(2, 46) +# define GLIB_AVAILABLE_TYPE_IN_2_46 GLIB_UNAVAILABLE_TYPE(2, 46) #else # define GLIB_AVAILABLE_IN_2_46 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_46 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_46 +# define GLIB_AVAILABLE_TYPE_IN_2_46 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_48 # define GLIB_DEPRECATED_IN_2_48 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_48_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_48 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_48_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_48 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_48_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_48 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_48_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_48 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_48_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_48 +# define GLIB_DEPRECATED_MACRO_IN_2_48_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_48 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_48_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_48 +# define GLIB_DEPRECATED_TYPE_IN_2_48_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_48 # define GLIB_AVAILABLE_IN_2_48 GLIB_UNAVAILABLE(2, 48) +# define GLIB_AVAILABLE_MACRO_IN_2_48 GLIB_UNAVAILABLE_MACRO(2, 48) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_48 GLIB_UNAVAILABLE_ENUMERATOR(2, 48) +# define GLIB_AVAILABLE_TYPE_IN_2_48 GLIB_UNAVAILABLE_TYPE(2, 48) #else # define GLIB_AVAILABLE_IN_2_48 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_48 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_48 +# define GLIB_AVAILABLE_TYPE_IN_2_48 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_50 # define GLIB_DEPRECATED_IN_2_50 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_50_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_50 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_50_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_50 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_50_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_50 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_50_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_50 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_50_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_50 +# define GLIB_DEPRECATED_MACRO_IN_2_50_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_50 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_50_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_50 +# define GLIB_DEPRECATED_TYPE_IN_2_50_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_50 # define GLIB_AVAILABLE_IN_2_50 GLIB_UNAVAILABLE(2, 50) +# define GLIB_AVAILABLE_MACRO_IN_2_50 GLIB_UNAVAILABLE_MACRO(2, 50) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_50 GLIB_UNAVAILABLE_ENUMERATOR(2, 50) +# define GLIB_AVAILABLE_TYPE_IN_2_50 GLIB_UNAVAILABLE_TYPE(2, 50) #else # define GLIB_AVAILABLE_IN_2_50 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_50 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_50 +# define GLIB_AVAILABLE_TYPE_IN_2_50 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_52 # define GLIB_DEPRECATED_IN_2_52 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_52_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_52 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_52_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_52 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_52_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_52 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_52_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_52 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_52_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_52 +# define GLIB_DEPRECATED_MACRO_IN_2_52_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_52 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_52_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_52 +# define GLIB_DEPRECATED_TYPE_IN_2_52_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_52 # define GLIB_AVAILABLE_IN_2_52 GLIB_UNAVAILABLE(2, 52) +# define GLIB_AVAILABLE_MACRO_IN_2_52 GLIB_UNAVAILABLE_MACRO(2, 52) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_52 GLIB_UNAVAILABLE_ENUMERATOR(2, 52) +# define GLIB_AVAILABLE_TYPE_IN_2_52 GLIB_UNAVAILABLE_TYPE(2, 52) #else # define GLIB_AVAILABLE_IN_2_52 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_52 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_52 +# define GLIB_AVAILABLE_TYPE_IN_2_52 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_54 # define GLIB_DEPRECATED_IN_2_54 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_54_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_54 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_54_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_54 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_54_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_54 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_54_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_54 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_54_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_54 +# define GLIB_DEPRECATED_MACRO_IN_2_54_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_54 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_54_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_54 +# define GLIB_DEPRECATED_TYPE_IN_2_54_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_54 # define GLIB_AVAILABLE_IN_2_54 GLIB_UNAVAILABLE(2, 54) +# define GLIB_AVAILABLE_MACRO_IN_2_54 GLIB_UNAVAILABLE_MACRO(2, 54) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_54 GLIB_UNAVAILABLE_ENUMERATOR(2, 54) +# define GLIB_AVAILABLE_TYPE_IN_2_54 GLIB_UNAVAILABLE_TYPE(2, 54) #else # define GLIB_AVAILABLE_IN_2_54 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_54 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_54 +# define GLIB_AVAILABLE_TYPE_IN_2_54 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_56 # define GLIB_DEPRECATED_IN_2_56 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_56_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_56 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_56_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_56 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_56_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_56 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_56_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_56 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_56_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_56 +# define GLIB_DEPRECATED_MACRO_IN_2_56_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_56 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_56_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_56 +# define GLIB_DEPRECATED_TYPE_IN_2_56_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_56 # define GLIB_AVAILABLE_IN_2_56 GLIB_UNAVAILABLE(2, 56) +# define GLIB_AVAILABLE_MACRO_IN_2_56 GLIB_UNAVAILABLE_MACRO(2, 56) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_56 GLIB_UNAVAILABLE_ENUMERATOR(2, 56) +# define GLIB_AVAILABLE_TYPE_IN_2_56 GLIB_UNAVAILABLE_TYPE(2, 56) #else # define GLIB_AVAILABLE_IN_2_56 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_56 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_56 +# define GLIB_AVAILABLE_TYPE_IN_2_56 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_58 # define GLIB_DEPRECATED_IN_2_58 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_58_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_58 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_58_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_58 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_58_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_58 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_58_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_58 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_58_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_58 +# define GLIB_DEPRECATED_MACRO_IN_2_58_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_58 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_58_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_58 +# define GLIB_DEPRECATED_TYPE_IN_2_58_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_58 # define GLIB_AVAILABLE_IN_2_58 GLIB_UNAVAILABLE(2, 58) +# define GLIB_AVAILABLE_MACRO_IN_2_58 GLIB_UNAVAILABLE_MACRO(2, 58) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_58 GLIB_UNAVAILABLE_ENUMERATOR(2, 58) +# define GLIB_AVAILABLE_TYPE_IN_2_58 GLIB_UNAVAILABLE_TYPE(2, 58) #else # define GLIB_AVAILABLE_IN_2_58 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_58 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_58 +# define GLIB_AVAILABLE_TYPE_IN_2_58 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_60 # define GLIB_DEPRECATED_IN_2_60 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_60_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_60 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_60_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_60 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_60_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_60 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_60_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_60 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_60_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_60 +# define GLIB_DEPRECATED_MACRO_IN_2_60_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_60 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_60_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_60 +# define GLIB_DEPRECATED_TYPE_IN_2_60_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_60 # define GLIB_AVAILABLE_IN_2_60 GLIB_UNAVAILABLE(2, 60) +# define GLIB_AVAILABLE_MACRO_IN_2_60 GLIB_UNAVAILABLE_MACRO(2, 60) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_60 GLIB_UNAVAILABLE_ENUMERATOR(2, 60) +# define GLIB_AVAILABLE_TYPE_IN_2_60 GLIB_UNAVAILABLE_TYPE(2, 60) #else # define GLIB_AVAILABLE_IN_2_60 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_60 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_60 +# define GLIB_AVAILABLE_TYPE_IN_2_60 #endif #if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_62 # define GLIB_DEPRECATED_IN_2_62 GLIB_DEPRECATED # define GLIB_DEPRECATED_IN_2_62_FOR(f) GLIB_DEPRECATED_FOR(f) +# define GLIB_DEPRECATED_MACRO_IN_2_62 GLIB_DEPRECATED_MACRO +# define GLIB_DEPRECATED_MACRO_IN_2_62_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_62 GLIB_DEPRECATED_ENUMERATOR +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_62_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_62 GLIB_DEPRECATED_TYPE +# define GLIB_DEPRECATED_TYPE_IN_2_62_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f) #else # define GLIB_DEPRECATED_IN_2_62 _GLIB_EXTERN # define GLIB_DEPRECATED_IN_2_62_FOR(f) _GLIB_EXTERN +# define GLIB_DEPRECATED_MACRO_IN_2_62 +# define GLIB_DEPRECATED_MACRO_IN_2_62_FOR(f) +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_62 +# define GLIB_DEPRECATED_ENUMERATOR_IN_2_62_FOR(f) +# define GLIB_DEPRECATED_TYPE_IN_2_62 +# define GLIB_DEPRECATED_TYPE_IN_2_62_FOR(f) #endif #if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_62 # define GLIB_AVAILABLE_IN_2_62 GLIB_UNAVAILABLE(2, 62) +# define GLIB_AVAILABLE_MACRO_IN_2_62 GLIB_UNAVAILABLE_MACRO(2, 62) +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_62 GLIB_UNAVAILABLE_ENUMERATOR(2, 62) +# define GLIB_AVAILABLE_TYPE_IN_2_62 GLIB_UNAVAILABLE_TYPE(2, 62) #else # define GLIB_AVAILABLE_IN_2_62 _GLIB_EXTERN +# define GLIB_AVAILABLE_MACRO_IN_2_62 +# define GLIB_AVAILABLE_ENUMERATOR_IN_2_62 +# define GLIB_AVAILABLE_TYPE_IN_2_62 #endif #endif /* __G_VERSION_MACROS_H__ */ -- GitLab From b4d58a7105bb9d75907233968bb534b38f9a6e43 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 May 2019 18:14:15 +0100 Subject: [PATCH 07/14] glib, gio: Use GLIB_DEPRECATED_MACRO instead of G_DISABLE_DEPRECATED MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When defining deprecated macros, annotate them with `GLIB_DEPRECATED_MACRO_IN_*()` and `GLIB_DEPRECATED_MACRO_IN_*_FOR()` to conditionally emit warnings if people use them, depending on their declared minimum and maximum GLib version requirements (see `GLIB_VERSION_MIN_REQUIRED` and `GLIB_VERSION_MAX_ALLOWED`). The old way of doing this was for users to define `G_DISABLE_DEPRECATED` if they didn’t want to use deprecated APIs, but it reported errors via missing symbols, and wasn’t version-dependent. It’s being phased out. Signed-off-by: Philip Withnall --- gio/gdesktopappinfo.h | 14 +++++--------- gio/gvolume.h | 4 +--- glib/deprecated/gmain.h | 20 ++++++++------------ glib/deprecated/gthread.h | 18 +++++++++--------- glib/gdate.h | 26 +++++++++++--------------- glib/gfileutils.h | 4 +--- glib/ghash.h | 6 ++---- glib/gmacros.h | 27 +++++++++++---------------- glib/gscanner.h | 14 +++++--------- glib/gstring.h | 6 ++---- glib/gunicode.h | 4 +--- glib/gutils.h | 9 ++------- 12 files changed, 58 insertions(+), 94 deletions(-) diff --git a/gio/gdesktopappinfo.h b/gio/gdesktopappinfo.h index 3ba5e2226a..591bdd2ef1 100644 --- a/gio/gdesktopappinfo.h +++ b/gio/gdesktopappinfo.h @@ -106,12 +106,10 @@ GLIB_AVAILABLE_IN_2_38 gchar * g_desktop_app_info_get_action_name (GDesktopAppInfo *info, const gchar *action_name); -#ifndef G_DISABLE_DEPRECATED - -#define G_TYPE_DESKTOP_APP_INFO_LOOKUP (g_desktop_app_info_lookup_get_type ()) -#define G_DESKTOP_APP_INFO_LOOKUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_DESKTOP_APP_INFO_LOOKUP, GDesktopAppInfoLookup)) -#define G_IS_DESKTOP_APP_INFO_LOOKUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_DESKTOP_APP_INFO_LOOKUP)) -#define G_DESKTOP_APP_INFO_LOOKUP_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_DESKTOP_APP_INFO_LOOKUP, GDesktopAppInfoLookupIface)) +#define G_TYPE_DESKTOP_APP_INFO_LOOKUP (g_desktop_app_info_lookup_get_type ()) GLIB_DEPRECATED_MACRO_IN_2_28 +#define G_DESKTOP_APP_INFO_LOOKUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_DESKTOP_APP_INFO_LOOKUP, GDesktopAppInfoLookup)) GLIB_DEPRECATED_MACRO_IN_2_28 +#define G_IS_DESKTOP_APP_INFO_LOOKUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_DESKTOP_APP_INFO_LOOKUP)) GLIB_DEPRECATED_MACRO_IN_2_28 +#define G_DESKTOP_APP_INFO_LOOKUP_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_DESKTOP_APP_INFO_LOOKUP, GDesktopAppInfoLookupIface)) GLIB_DEPRECATED_MACRO_IN_2_28 /** * G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME: @@ -122,9 +120,7 @@ gchar * g_desktop_app_info_get_action_name (GDeskto * Deprecated: 2.28: The #GDesktopAppInfoLookup interface is deprecated and * unused by GIO. */ -#define G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME "gio-desktop-app-info-lookup" - -#endif /* G_DISABLE_DEPRECATED */ +#define G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME "gio-desktop-app-info-lookup" GLIB_DEPRECATED_MACRO_IN_2_28 /** * GDesktopAppInfoLookupIface: diff --git a/gio/gvolume.h b/gio/gvolume.h index 6d8a814dce..e153b7c38c 100644 --- a/gio/gvolume.h +++ b/gio/gvolume.h @@ -30,7 +30,6 @@ G_BEGIN_DECLS -#ifndef G_DISABLE_DEPRECATED /** * G_VOLUME_IDENTIFIER_KIND_HAL_UDI: * @@ -38,8 +37,7 @@ G_BEGIN_DECLS * * Deprecated: 2.58: Do not use, HAL is deprecated. */ -#define G_VOLUME_IDENTIFIER_KIND_HAL_UDI "hal-udi" -#endif /* G_DISABLE_DEPRECATED */ +#define G_VOLUME_IDENTIFIER_KIND_HAL_UDI "hal-udi" GLIB_DEPRECATED_MACRO_IN_2_58 /** * G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE: diff --git a/glib/deprecated/gmain.h b/glib/deprecated/gmain.h index d14dd0ed3a..2199328fd2 100644 --- a/glib/deprecated/gmain.h +++ b/glib/deprecated/gmain.h @@ -33,8 +33,6 @@ G_BEGIN_DECLS -#ifndef G_DISABLE_DEPRECATED - /* ============== Compat main loop stuff ================== */ /** @@ -49,7 +47,7 @@ G_BEGIN_DECLS * * Deprecated: 2.2: Use g_main_loop_new() instead */ -#define g_main_new(is_running) g_main_loop_new (NULL, is_running) +#define g_main_new(is_running) g_main_loop_new (NULL, is_running) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_new) /** * g_main_run: @@ -59,7 +57,7 @@ G_BEGIN_DECLS * * Deprecated: 2.2: Use g_main_loop_run() instead */ -#define g_main_run(loop) g_main_loop_run(loop) +#define g_main_run(loop) g_main_loop_run(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_run) /** * g_main_quit: @@ -70,7 +68,7 @@ G_BEGIN_DECLS * * Deprecated: 2.2: Use g_main_loop_quit() instead */ -#define g_main_quit(loop) g_main_loop_quit(loop) +#define g_main_quit(loop) g_main_loop_quit(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_quit) /** * g_main_destroy: @@ -80,7 +78,7 @@ G_BEGIN_DECLS * * Deprecated: 2.2: Use g_main_loop_unref() instead */ -#define g_main_destroy(loop) g_main_loop_unref(loop) +#define g_main_destroy(loop) g_main_loop_unref(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_unref) /** * g_main_is_running: @@ -92,7 +90,7 @@ G_BEGIN_DECLS * * Deprecated: 2.2: Use g_main_loop_is_running() instead */ -#define g_main_is_running(loop) g_main_loop_is_running(loop) +#define g_main_is_running(loop) g_main_loop_is_running(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_is_running) /** * g_main_iteration: @@ -107,7 +105,7 @@ G_BEGIN_DECLS * * Deprecated: 2.2: Use g_main_context_iteration() instead. */ -#define g_main_iteration(may_block) g_main_context_iteration (NULL, may_block) +#define g_main_iteration(may_block) g_main_context_iteration (NULL, may_block) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_context_iteration) /** * g_main_pending: @@ -119,7 +117,7 @@ G_BEGIN_DECLS * * Deprected: 2.2: Use g_main_context_pending() instead. */ -#define g_main_pending() g_main_context_pending (NULL) +#define g_main_pending() g_main_context_pending (NULL) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_context_pending) /** * g_main_set_poll_func: @@ -130,9 +128,7 @@ G_BEGIN_DECLS * * Deprecated: 2.2: Use g_main_context_set_poll_func() again */ -#define g_main_set_poll_func(func) g_main_context_set_poll_func (NULL, func) - -#endif +#define g_main_set_poll_func(func) g_main_context_set_poll_func (NULL, func) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_context_set_poll_func) G_END_DECLS diff --git a/glib/deprecated/gthread.h b/glib/deprecated/gthread.h index 9e1c2ff56c..c544bbca09 100644 --- a/glib/deprecated/gthread.h +++ b/glib/deprecated/gthread.h @@ -128,8 +128,8 @@ void g_thread_foreach (GFunc thread_func, #include #endif -#define g_static_mutex_get_mutex g_static_mutex_get_mutex_impl -#define G_STATIC_MUTEX_INIT { NULL } +#define g_static_mutex_get_mutex g_static_mutex_get_mutex_impl GLIB_DEPRECATED_MACRO_IN_2_32 +#define G_STATIC_MUTEX_INIT { NULL } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_init) typedef struct { GMutex *mutex; @@ -140,11 +140,11 @@ typedef struct } GStaticMutex; #define g_static_mutex_lock(mutex) \ - g_mutex_lock (g_static_mutex_get_mutex (mutex)) + g_mutex_lock (g_static_mutex_get_mutex (mutex)) GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_lock) #define g_static_mutex_trylock(mutex) \ - g_mutex_trylock (g_static_mutex_get_mutex (mutex)) + g_mutex_trylock (g_static_mutex_get_mutex (mutex)) GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_trylock) #define g_static_mutex_unlock(mutex) \ - g_mutex_unlock (g_static_mutex_get_mutex (mutex)) + g_mutex_unlock (g_static_mutex_get_mutex (mutex)) GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_unlock) GLIB_DEPRECATED_IN_2_32_FOR(g_mutex_init) void g_static_mutex_init (GStaticMutex *mutex); @@ -171,7 +171,7 @@ struct _GStaticRecMutex } unused; }; -#define G_STATIC_REC_MUTEX_INIT { G_STATIC_MUTEX_INIT, 0, { 0 } } +#define G_STATIC_REC_MUTEX_INIT { G_STATIC_MUTEX_INIT, 0, { 0 } } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_rec_mutex_init) GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_init) void g_static_rec_mutex_init (GStaticRecMutex *mutex); @@ -207,7 +207,7 @@ struct _GStaticRWLock guint want_to_write; }; -#define G_STATIC_RW_LOCK_INIT { G_STATIC_MUTEX_INIT, NULL, NULL, 0, FALSE, 0, 0 } +#define G_STATIC_RW_LOCK_INIT { G_STATIC_MUTEX_INIT, NULL, NULL, 0, FALSE, 0, 0 } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_rw_lock_init) GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_init) void g_static_rw_lock_init (GStaticRWLock *lock); @@ -243,7 +243,7 @@ struct _GStaticPrivate guint index; }; -#define G_STATIC_PRIVATE_INIT { 0 } +#define G_STATIC_PRIVATE_INIT { 0 } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(G_PRIVATE_INIT) GLIB_DEPRECATED_IN_2_32 void g_static_private_init (GStaticPrivate *private_key); @@ -271,7 +271,7 @@ gboolean g_thread_get_initialized (void); GLIB_VAR gboolean g_threads_got_initialized; -#define g_thread_supported() (1) +#define g_thread_supported() (1) GLIB_DEPRECATED_MACRO_IN_2_32 GLIB_DEPRECATED_IN_2_32 GMutex * g_mutex_new (void); diff --git a/glib/gdate.h b/glib/gdate.h index 63feb3535b..3e1d8c8d5d 100644 --- a/glib/gdate.h +++ b/glib/gdate.h @@ -290,21 +290,17 @@ gsize g_date_strftime (gchar *s, const gchar *format, const GDate *date); -#ifndef G_DISABLE_DEPRECATED - -#define g_date_weekday g_date_get_weekday -#define g_date_month g_date_get_month -#define g_date_year g_date_get_year -#define g_date_day g_date_get_day -#define g_date_julian g_date_get_julian -#define g_date_day_of_year g_date_get_day_of_year -#define g_date_monday_week_of_year g_date_get_monday_week_of_year -#define g_date_sunday_week_of_year g_date_get_sunday_week_of_year -#define g_date_days_in_month g_date_get_days_in_month -#define g_date_monday_weeks_in_year g_date_get_monday_weeks_in_year -#define g_date_sunday_weeks_in_year g_date_get_sunday_weeks_in_year - -#endif /* G_DISABLE_DEPRECATED */ +#define g_date_weekday g_date_get_weekday GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_weekday) +#define g_date_month g_date_get_month GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_month) +#define g_date_year g_date_get_year GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_year) +#define g_date_day g_date_get_day GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_day) +#define g_date_julian g_date_get_julian GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_julian) +#define g_date_day_of_year g_date_get_day_of_year GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_day_of_year) +#define g_date_monday_week_of_year g_date_get_monday_week_of_year GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_monday_week_of_year) +#define g_date_sunday_week_of_year g_date_get_sunday_week_of_year GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_sunday_week_of_year) +#define g_date_days_in_month g_date_get_days_in_month GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_days_in_month) +#define g_date_monday_weeks_in_year g_date_get_monday_weeks_in_year GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_monday_weeks_in_year) +#define g_date_sunday_weeks_in_year g_date_get_sunday_weeks_in_year GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_date_get_sunday_weeks_in_year) G_END_DECLS diff --git a/glib/gfileutils.h b/glib/gfileutils.h index bcaaa40ffb..f60fad8584 100644 --- a/glib/gfileutils.h +++ b/glib/gfileutils.h @@ -161,9 +161,7 @@ const gchar *g_path_skip_root (const gchar *file_name); GLIB_DEPRECATED_FOR(g_path_get_basename) const gchar *g_basename (const gchar *file_name); -#ifndef G_DISABLE_DEPRECATED -#define g_dirname g_path_get_dirname -#endif +#define g_dirname g_path_get_dirname GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_path_get_dirname) GLIB_AVAILABLE_IN_ALL gchar *g_get_current_dir (void); diff --git a/glib/ghash.h b/glib/ghash.h index 0256d54113..e9ce64505f 100644 --- a/glib/ghash.h +++ b/glib/ghash.h @@ -148,10 +148,8 @@ GHashTable* g_hash_table_ref (GHashTable *hash_table); GLIB_AVAILABLE_IN_ALL void g_hash_table_unref (GHashTable *hash_table); -#ifndef G_DISABLE_DEPRECATED -#define g_hash_table_freeze(hash_table) ((void)0) -#define g_hash_table_thaw(hash_table) ((void)0) -#endif +#define g_hash_table_freeze(hash_table) ((void)0) GLIB_DEPRECATED_MACRO_IN_2_26 +#define g_hash_table_thaw(hash_table) ((void)0) GLIB_DEPRECATED_MACRO_IN_2_26 /* Hash Functions */ diff --git a/glib/gmacros.h b/glib/gmacros.h index 8a311d1384..629d14be8f 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -96,17 +96,15 @@ * Deprecated: 2.48: Use "static inline" instead */ -#ifndef G_DISABLE_DEPRECATED /* For historical reasons we need to continue to support those who * define G_IMPLEMENT_INLINES to mean "don't implement this here". */ #ifdef G_IMPLEMENT_INLINES -# define G_INLINE_FUNC extern +# define G_INLINE_FUNC extern GLIB_DEPRECATED_MACRO_IN_2_48_FOR(static inline) # undef G_CAN_INLINE #else -# define G_INLINE_FUNC static inline +# define G_INLINE_FUNC static inline GLIB_DEPRECATED_MACRO_IN_2_48_FOR(static inline) #endif /* G_IMPLEMENT_INLINES */ -#endif /* !G_DISABLE_DEPRECATED */ /* Provide macros to feature the GCC function attribute. */ @@ -707,19 +705,20 @@ * Deprecated: 2.16: Use G_STRFUNC() instead */ -#ifndef G_DISABLE_DEPRECATED /* Wrap the gcc __PRETTY_FUNCTION__ and __FUNCTION__ variables with * macros, so we can refer to them as strings unconditionally. * usage not-recommended since gcc-3.0 + * + * Mark them as deprecated since 2.26, since that’s when version macros were + * introduced. */ #if defined (__GNUC__) && (__GNUC__ < 3) -#define G_GNUC_FUNCTION __FUNCTION__ -#define G_GNUC_PRETTY_FUNCTION __PRETTY_FUNCTION__ +#define G_GNUC_FUNCTION __FUNCTION__ GLIB_DEPRECATED_MACRO_IN_2_26_FOR(G_STRFUNC) +#define G_GNUC_PRETTY_FUNCTION __PRETTY_FUNCTION__ GLIB_DEPRECATED_MACRO_IN_2_26_FOR(G_STRFUNC) #else /* !__GNUC__ */ -#define G_GNUC_FUNCTION "" -#define G_GNUC_PRETTY_FUNCTION "" +#define G_GNUC_FUNCTION "" GLIB_DEPRECATED_MACRO_IN_2_26_FOR(G_STRFUNC) +#define G_GNUC_PRETTY_FUNCTION "" GLIB_DEPRECATED_MACRO_IN_2_26_FOR(G_STRFUNC) #endif /* !__GNUC__ */ -#endif /* !G_DISABLE_DEPRECATED */ #if g_macro__has_feature(attribute_analyzer_noreturn) && defined(__clang_analyzer__) #define G_ANALYZER_ANALYZING 1 @@ -900,15 +899,11 @@ * Deprecated: 2.30: API providers should replace all existing uses with * const and API consumers should adjust their code accordingly */ - -/* Deprecated -- do not use. */ -#ifndef G_DISABLE_DEPRECATED #ifdef G_DISABLE_CONST_RETURNS -#define G_CONST_RETURN +#define G_CONST_RETURN GLIB_DEPRECATED_MACRO_IN_2_30_FOR(const) #else -#define G_CONST_RETURN const +#define G_CONST_RETURN const GLIB_DEPRECATED_MACRO_IN_2_30_FOR(const) #endif -#endif /* !G_DISABLE_DEPRECATED */ /* * The G_LIKELY and G_UNLIKELY macros let the programmer give hints to diff --git a/glib/gscanner.h b/glib/gscanner.h index db0d9aaf9c..d87b4533ec 100644 --- a/glib/gscanner.h +++ b/glib/gscanner.h @@ -278,25 +278,21 @@ void g_scanner_warn (GScanner *scanner, const gchar *format, ...) G_GNUC_PRINTF (2,3); -#ifndef G_DISABLE_DEPRECATED - /* keep downward source compatibility */ #define g_scanner_add_symbol( scanner, symbol, value ) G_STMT_START { \ g_scanner_scope_add_symbol ((scanner), 0, (symbol), (value)); \ -} G_STMT_END +} G_STMT_END GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_scanner_scope_add_symbol) #define g_scanner_remove_symbol( scanner, symbol ) G_STMT_START { \ g_scanner_scope_remove_symbol ((scanner), 0, (symbol)); \ -} G_STMT_END +} G_STMT_END GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_scanner_scope_remove_symbol) #define g_scanner_foreach_symbol( scanner, func, data ) G_STMT_START { \ g_scanner_scope_foreach_symbol ((scanner), 0, (func), (data)); \ -} G_STMT_END +} G_STMT_END GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_scanner_scope_foreach_symbol) /* The following two functions are deprecated and will be removed in * the next major release. They do no good. */ -#define g_scanner_freeze_symbol_table(scanner) ((void)0) -#define g_scanner_thaw_symbol_table(scanner) ((void)0) - -#endif /* G_DISABLE_DEPRECATED */ +#define g_scanner_freeze_symbol_table(scanner) ((void)0) GLIB_DEPRECATED_MACRO_IN_2_26 +#define g_scanner_thaw_symbol_table(scanner) ((void)0) GLIB_DEPRECATED_MACRO_IN_2_26 G_END_DECLS diff --git a/glib/gstring.h b/glib/gstring.h index 77951b041a..e1b2e7fca7 100644 --- a/glib/gstring.h +++ b/glib/gstring.h @@ -179,10 +179,8 @@ GString *g_string_down (GString *string); GLIB_DEPRECATED GString *g_string_up (GString *string); -#ifndef G_DISABLE_DEPRECATED -#define g_string_sprintf g_string_printf -#define g_string_sprintfa g_string_append_printf -#endif +#define g_string_sprintf g_string_printf GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_string_printf) +#define g_string_sprintfa g_string_append_printf GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_string_append_printf) G_END_DECLS diff --git a/glib/gunicode.h b/glib/gunicode.h index 700a3f2d92..201af5ce86 100644 --- a/glib/gunicode.h +++ b/glib/gunicode.h @@ -154,9 +154,7 @@ typedef enum * * Deprecated: 2.30: Use %G_UNICODE_SPACING_MARK. */ -#ifndef G_DISABLE_DEPRECATED -#define G_UNICODE_COMBINING_MARK G_UNICODE_SPACING_MARK -#endif +#define G_UNICODE_COMBINING_MARK G_UNICODE_SPACING_MARK GLIB_DEPRECATED_MACRO_IN_2_30_FOR(G_UNICODE_SPACING_MARK) /** * GUnicodeBreakType: diff --git a/glib/gutils.h b/glib/gutils.h index 070f9cff56..352ab6a305 100644 --- a/glib/gutils.h +++ b/glib/gutils.h @@ -311,8 +311,6 @@ void g_abort (void) G_GNUC_NORETURN G_ANALYZER_NORETURN; #endif #endif -#ifndef G_DISABLE_DEPRECATED - /* * This macro is deprecated. This DllMain() is too complex. It is * recommended to write an explicit minimal DLlMain() that just saves @@ -331,7 +329,7 @@ void g_abort (void) G_GNUC_NORETURN G_ANALYZER_NORETURN; */ #ifndef G_PLATFORM_WIN32 -# define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name) +# define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name) GLIB_DEPRECATED_MACRO_IN_2_26 #else # define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name) \ static char *dll_name; \ @@ -354,10 +352,7 @@ DllMain (HINSTANCE hinstDLL, \ } \ \ return TRUE; \ -} - -#endif /* !G_DISABLE_DEPRECATED */ - +} GLIB_DEPRECATED_MACRO_IN_2_26 #endif /* G_PLATFORM_WIN32 */ G_END_DECLS -- GitLab From 74ca348e9949a68a8d32a44790f4c88753ccfc60 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 May 2019 18:17:22 +0100 Subject: [PATCH 08/14] glib: Unconditionally include deprecated headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows the symbols there to be used conditionally, depending on the user’s stated `GLIB_VERSION_MIN_REQUIRED` and `GLIB_VERSION_MAX_ALLOWED` preferences. Signed-off-by: Philip Withnall --- glib/glib.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/glib/glib.h b/glib/glib.h index 94a11fb62e..5c21b6bf65 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -102,14 +102,12 @@ #include #endif -#ifndef G_DISABLE_DEPRECATED #include #include #include #include #include #include -#endif /* G_DISABLE_DEPRECATED */ #include -- GitLab From 6554c91b1312013e42b42931ee07b961b7e0cdb0 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 May 2019 18:20:04 +0100 Subject: [PATCH 09/14] gutils: Move g_ATEXIT() and g_memmove() definitions from glibconfig.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The definitions weren’t templated in glibconfig.h.in at all, so didn’t vary between configurations of GLib — so they should be in a normal header. Move them to gutils.h and fix the deprecation annotations. Signed-off-by: Philip Withnall --- glib/glibconfig.h.in | 5 ----- glib/gutils.h | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/glib/glibconfig.h.in b/glib/glibconfig.h.in index 2bf6c43c1e..7ef8c481d7 100644 --- a/glib/glibconfig.h.in +++ b/glib/glibconfig.h.in @@ -108,11 +108,6 @@ typedef unsigned @glib_intptr_type_define@ guintptr; #define G_GINTPTR_FORMAT @gintptr_format@ #define G_GUINTPTR_FORMAT @guintptr_format@ -#ifndef G_DISABLE_DEPRECATED -#define g_ATEXIT(proc) (atexit (proc)) -#define g_memmove(dest,src,len) G_STMT_START { memmove ((dest), (src), (len)); } G_STMT_END -#endif - #define GLIB_MAJOR_VERSION @GLIB_MAJOR_VERSION@ #define GLIB_MINOR_VERSION @GLIB_MINOR_VERSION@ #define GLIB_MICRO_VERSION @GLIB_MICRO_VERSION@ diff --git a/glib/gutils.h b/glib/gutils.h index 352ab6a305..055ca46057 100644 --- a/glib/gutils.h +++ b/glib/gutils.h @@ -194,6 +194,10 @@ gchar *g_format_size (guint64 size); GLIB_DEPRECATED_IN_2_30_FOR(g_format_size) gchar *g_format_size_for_display (goffset size); +#define g_ATEXIT(proc) (atexit (proc)) GLIB_DEPRECATED_MACRO_IN_2_32 +#define g_memmove(dest,src,len) \ + G_STMT_START { memmove ((dest), (src), (len)); } G_STMT_END GLIB_DEPRECATED_MACRO_IN_2_40_FOR(memmove) + #ifndef G_DISABLE_DEPRECATED /** * GVoidFunc: -- GitLab From f0fb7b77a13e5fc9a5053f0b11264d1af9a853cc Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 May 2019 19:29:07 +0100 Subject: [PATCH 10/14] glib, gobject: Annotate deprecated types and enumerators Use the new `GLIB_DEPRECATED_{TYPE,ENUMERATOR}*` macros to annotate types and enumerators as deprecated, rather than using `G_DISABLE_DEPRECATED`. Signed-off-by: Philip Withnall --- glib/deprecated/gcache.h | 12 ++++++------ glib/deprecated/gthread.h | 28 ++++++++++++---------------- glib/gspawn.h | 6 ++---- glib/gutils.c | 2 ++ glib/gutils.h | 12 ++++++------ gobject/gparam.h | 4 +--- 6 files changed, 29 insertions(+), 35 deletions(-) diff --git a/glib/deprecated/gcache.h b/glib/deprecated/gcache.h index 2885697f97..e1c1f2cde6 100644 --- a/glib/deprecated/gcache.h +++ b/glib/deprecated/gcache.h @@ -33,13 +33,13 @@ G_BEGIN_DECLS -#ifndef G_DISABLE_DEPRECATED +typedef struct _GCache GCache GLIB_DEPRECATED_TYPE_IN_2_26_FOR(GHashTable); -typedef struct _GCache GCache; +typedef gpointer (*GCacheNewFunc) (gpointer key) GLIB_DEPRECATED_TYPE_IN_2_26; +typedef gpointer (*GCacheDupFunc) (gpointer value) GLIB_DEPRECATED_TYPE_IN_2_26; +typedef void (*GCacheDestroyFunc) (gpointer value) GLIB_DEPRECATED_TYPE_IN_2_26; -typedef gpointer (*GCacheNewFunc) (gpointer key); -typedef gpointer (*GCacheDupFunc) (gpointer value); -typedef void (*GCacheDestroyFunc) (gpointer value); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS /* Caches */ @@ -68,7 +68,7 @@ void g_cache_value_foreach (GCache *cache, GHFunc func, gpointer user_data); -#endif +G_GNUC_END_IGNORE_DEPRECATIONS G_END_DECLS diff --git a/glib/deprecated/gthread.h b/glib/deprecated/gthread.h index c544bbca09..33b422240d 100644 --- a/glib/deprecated/gthread.h +++ b/glib/deprecated/gthread.h @@ -33,7 +33,7 @@ G_BEGIN_DECLS -#ifndef G_DISABLE_DEPRECATED +G_GNUC_BEGIN_IGNORE_DEPRECATIONS typedef enum { @@ -41,9 +41,7 @@ typedef enum G_THREAD_PRIORITY_NORMAL, G_THREAD_PRIORITY_HIGH, G_THREAD_PRIORITY_URGENT -} GThreadPriority; - -#endif +} GThreadPriority GLIB_DEPRECATED_TYPE_IN_2_32; struct _GThread { @@ -54,9 +52,7 @@ struct _GThread GThreadPriority priority; }; -#ifndef G_DISABLE_DEPRECATED - -typedef struct _GThreadFunctions GThreadFunctions; +typedef struct _GThreadFunctions GThreadFunctions GLIB_DEPRECATED_TYPE_IN_2_32; struct _GThreadFunctions { GMutex* (*mutex_new) (void); @@ -93,7 +89,7 @@ struct _GThreadFunctions void (*thread_self) (gpointer thread); gboolean (*thread_equal) (gpointer thread1, gpointer thread2); -}; +} GLIB_DEPRECATED_TYPE_IN_2_32; GLIB_VAR GThreadFunctions g_thread_functions_for_glib_use; GLIB_VAR gboolean g_thread_use_default_impl; @@ -137,7 +133,7 @@ typedef struct /* only for ABI compatibility reasons */ pthread_mutex_t unused; #endif -} GStaticMutex; +} GStaticMutex GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GMutex); #define g_static_mutex_lock(mutex) \ g_mutex_lock (g_static_mutex_get_mutex (mutex)) GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_lock) @@ -153,7 +149,7 @@ void g_static_mutex_free (GStaticMutex *mutex); GLIB_DEPRECATED_IN_2_32_FOR(GMutex) GMutex *g_static_mutex_get_mutex_impl (GStaticMutex *mutex); -typedef struct _GStaticRecMutex GStaticRecMutex; +typedef struct _GStaticRecMutex GStaticRecMutex GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GRecMutex); struct _GStaticRecMutex { /*< private >*/ @@ -169,7 +165,7 @@ struct _GStaticRecMutex #endif gdouble dummy; } unused; -}; +} GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GRecMutex); #define G_STATIC_REC_MUTEX_INIT { G_STATIC_MUTEX_INIT, 0, { 0 } } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_rec_mutex_init) GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_init) @@ -194,7 +190,7 @@ guint g_static_rec_mutex_unlock_full (GStaticRecMutex *mutex); GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_free) void g_static_rec_mutex_free (GStaticRecMutex *mutex); -typedef struct _GStaticRWLock GStaticRWLock; +typedef struct _GStaticRWLock GStaticRWLock GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GRWLock); struct _GStaticRWLock { /*< private >*/ @@ -205,7 +201,7 @@ struct _GStaticRWLock gboolean have_writer; guint want_to_read; guint want_to_write; -}; +} GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GRWLock); #define G_STATIC_RW_LOCK_INIT { G_STATIC_MUTEX_INIT, NULL, NULL, 0, FALSE, 0, 0 } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_rw_lock_init) @@ -236,12 +232,12 @@ void g_static_rw_lock_free (GStaticRWLock *lock); GLIB_DEPRECATED_IN_2_32 GPrivate * g_private_new (GDestroyNotify notify); -typedef struct _GStaticPrivate GStaticPrivate; +typedef struct _GStaticPrivate GStaticPrivate GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GPrivate); struct _GStaticPrivate { /*< private >*/ guint index; -}; +} GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GPrivate); #define G_STATIC_PRIVATE_INIT { 0 } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(G_PRIVATE_INIT) GLIB_DEPRECATED_IN_2_32 @@ -286,7 +282,7 @@ gboolean g_cond_timed_wait (GCond *cond, GMutex *mutex, GTimeVal *timeval); -#endif +G_GNUC_END_IGNORE_DEPRECATIONS G_END_DECLS diff --git a/glib/gspawn.h b/glib/gspawn.h index d6b0be7d07..240aae768e 100644 --- a/glib/gspawn.h +++ b/glib/gspawn.h @@ -46,7 +46,7 @@ G_BEGIN_DECLS * @G_SPAWN_ERROR_ACCES: execv() returned `EACCES` * @G_SPAWN_ERROR_PERM: execv() returned `EPERM` * @G_SPAWN_ERROR_TOO_BIG: execv() returned `E2BIG` - * @G_SPAWN_ERROR_2BIG: deprecated alias for %G_SPAWN_ERROR_TOO_BIG + * @G_SPAWN_ERROR_2BIG: deprecated alias for %G_SPAWN_ERROR_TOO_BIG (deprecated since GLib 2.32) * @G_SPAWN_ERROR_NOEXEC: execv() returned `ENOEXEC` * @G_SPAWN_ERROR_NAMETOOLONG: execv() returned `ENAMETOOLONG` * @G_SPAWN_ERROR_NOENT: execv() returned `ENOENT` @@ -73,9 +73,7 @@ typedef enum G_SPAWN_ERROR_ACCES, /* execv() returned EACCES */ G_SPAWN_ERROR_PERM, /* execv() returned EPERM */ G_SPAWN_ERROR_TOO_BIG,/* execv() returned E2BIG */ -#ifndef G_DISABLE_DEPRECATED - G_SPAWN_ERROR_2BIG = G_SPAWN_ERROR_TOO_BIG, -#endif + G_SPAWN_ERROR_2BIG GLIB_DEPRECATED_ENUMERATOR_IN_2_32_FOR(G_SPAWN_ERROR_TOO_BIG) = G_SPAWN_ERROR_TOO_BIG, G_SPAWN_ERROR_NOEXEC, /* execv() returned ENOEXEC */ G_SPAWN_ERROR_NAMETOOLONG, /* "" "" ENAMETOOLONG */ G_SPAWN_ERROR_NOENT, /* "" "" ENOENT */ diff --git a/glib/gutils.c b/glib/gutils.c index 9e2f0b0b75..87db6a1f3e 100644 --- a/glib/gutils.c +++ b/glib/gutils.c @@ -218,6 +218,7 @@ _glib_get_dll_directory (void) * * Deprecated:2.32: It is best to avoid g_atexit(). */ +G_GNUC_BEGIN_IGNORE_DEPRECATIONS void g_atexit (GVoidFunc func) { @@ -232,6 +233,7 @@ g_atexit (GVoidFunc func) g_strerror (errsv)); } } +G_GNUC_END_IGNORE_DEPRECATIONS /* Based on execvp() from GNU Libc. * Some of this code is cut-and-pasted into gspawn.c diff --git a/glib/gutils.h b/glib/gutils.h index 055ca46057..560a84e3ac 100644 --- a/glib/gutils.h +++ b/glib/gutils.h @@ -198,7 +198,6 @@ gchar *g_format_size_for_display (goffset size); #define g_memmove(dest,src,len) \ G_STMT_START { memmove ((dest), (src), (len)); } G_STMT_END GLIB_DEPRECATED_MACRO_IN_2_40_FOR(memmove) -#ifndef G_DISABLE_DEPRECATED /** * GVoidFunc: * @@ -206,10 +205,13 @@ gchar *g_format_size_for_display (goffset size); * and has no return value. It is used to specify the type * function passed to g_atexit(). */ -typedef void (*GVoidFunc) (void); -#define ATEXIT(proc) g_ATEXIT(proc) +typedef void (*GVoidFunc) (void) GLIB_DEPRECATED_TYPE_IN_2_32; +#define ATEXIT(proc) g_ATEXIT(proc) GLIB_DEPRECATED_MACRO_IN_2_32 + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS GLIB_DEPRECATED void g_atexit (GVoidFunc func); +G_GNUC_END_IGNORE_DEPRECATIONS #ifdef G_OS_WIN32 /* It's a bad idea to wrap atexit() on Windows. If the GLib DLL calls @@ -221,9 +223,7 @@ void g_atexit (GVoidFunc func); #if (defined(__MINGW_H) && !defined(_STDLIB_H_)) || (defined(_MSC_VER) && !defined(_INC_STDLIB)) int atexit (void (*)(void)); #endif -#define g_atexit(func) atexit(func) -#endif - +#define g_atexit(func) atexit(func) GLIB_DEPRECATED_MACRO_IN_2_32 #endif diff --git a/gobject/gparam.h b/gobject/gparam.h index 535b980357..97a90dbe43 100644 --- a/gobject/gparam.h +++ b/gobject/gparam.h @@ -156,9 +156,7 @@ typedef enum G_PARAM_CONSTRUCT_ONLY = 1 << 3, G_PARAM_LAX_VALIDATION = 1 << 4, G_PARAM_STATIC_NAME = 1 << 5, -#ifndef G_DISABLE_DEPRECATED - G_PARAM_PRIVATE = G_PARAM_STATIC_NAME, -#endif + G_PARAM_PRIVATE GLIB_DEPRECATED_ENUMERATOR_IN_2_26 = G_PARAM_STATIC_NAME, G_PARAM_STATIC_NICK = 1 << 6, G_PARAM_STATIC_BLURB = 1 << 7, /* User defined flags go here */ -- GitLab From e62e89f2f8b8eb6e0aace419f9a1adeaae7ba56b Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 May 2019 19:30:31 +0100 Subject: [PATCH 11/14] Fix various deprecation warnings in code and tests This code uses, or tests, deprecated functions, types or macros; so needs to be compiled with deprecation warnings disabled. Signed-off-by: Philip Withnall --- gio/giomodule.c | 6 ++++-- glib/deprecated/gcache.c | 3 +++ tests/asyncqueue-test.c | 1 - tests/testglib.c | 16 ++++++++-------- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/gio/giomodule.c b/gio/giomodule.c index ee1b0b6f46..9bb28985a1 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 7056c13ac5..179ad9e17e 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 0cf67b21b1..2dd8563c74 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 687fadd5bd..372ddae2ca 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); -- GitLab From 99b412bb192c0062753cbf960169b1f99335080f Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 May 2019 19:31:30 +0100 Subject: [PATCH 12/14] gdate: Drop unnecessary use of G_DISABLE_DEPRECATED The function is already annotated with `GLIB_DEPRECATED_FOR()`. Signed-off-by: Philip Withnall --- glib/gdate.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/glib/gdate.h b/glib/gdate.h index 3e1d8c8d5d..b7cd44e077 100644 --- a/glib/gdate.h +++ b/glib/gdate.h @@ -198,11 +198,9 @@ void g_date_set_time_t (GDate *date, GLIB_AVAILABLE_IN_ALL void g_date_set_time_val (GDate *date, GTimeVal *timeval); -#ifndef G_DISABLE_DEPRECATED GLIB_DEPRECATED_FOR(g_date_set_time_t) void g_date_set_time (GDate *date, GTime time_); -#endif GLIB_AVAILABLE_IN_ALL void g_date_set_month (GDate *date, GDateMonth month); -- GitLab From 1741fc2c6eb8e11f4e786ccc5c19c0da327630a5 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 May 2019 18:19:07 +0100 Subject: [PATCH 13/14] build: Drop use of G_DISABLE_DEPRECATED from the build system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s no longer used in any of the headers. See preceding commits. Signed-off-by: Philip Withnall --- docs/reference/glib/compiling.xml | 7 +++---- docs/reference/meson.build | 1 - gio/fam/meson.build | 2 +- gio/inotify/meson.build | 2 +- gio/kqueue/meson.build | 2 +- gio/win32/meson.build | 2 +- gmodule/meson.build | 2 +- 7 files changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/reference/glib/compiling.xml b/docs/reference/glib/compiling.xml index 6a86264883..02971a60fe 100644 --- a/docs/reference/glib/compiling.xml +++ b/docs/reference/glib/compiling.xml @@ -93,11 +93,10 @@ this range will trigger compiler warnings. -The older deprecation mechanism of hiding deprecated interfaces +Since GLib 2.62, the older deprecation mechanism of hiding deprecated interfaces entirely from the compiler by using the preprocessor symbol -G_DISABLE_DEPRECATED is still used for deprecated macros, -enumeration values, etc. To detect uses of these in your code, -use the commandline option -DG_DISABLE_DEPRECATED. +G_DISABLE_DEPRECATED has been removed. All deprecations +are now handled using the above mechanism. diff --git a/docs/reference/meson.build b/docs/reference/meson.build index e4dbf3f128..8da9665f4e 100644 --- a/docs/reference/meson.build +++ b/docs/reference/meson.build @@ -26,7 +26,6 @@ foreach version : stable_2_series_versions endforeach gtkdoc_common_scan_args = [ - '--deprecated-guards=G_DISABLE_DEPRECATED', '--ignore-decorators=' + '|'.join(ignore_decorators), ] diff --git a/gio/fam/meson.build b/gio/fam/meson.build index d24670a631..8019fe5c40 100644 --- a/gio/fam/meson.build +++ b/gio/fam/meson.build @@ -3,7 +3,7 @@ if not get_option('fam') endif fam_dep = cc.find_library('fam') -fam_c_args = ['-DG_DISABLE_DEPRECATED'] + gio_c_args +fam_c_args = gio_c_args if cc.has_function('FAMNoExists', dependencies : fam_dep) fam_c_args += '-DHAVE_FAM_NO_EXISTS=1' endif diff --git a/gio/inotify/meson.build b/gio/inotify/meson.build index 8183f141e1..9b0c7ab300 100644 --- a/gio/inotify/meson.build +++ b/gio/inotify/meson.build @@ -12,4 +12,4 @@ inotify_lib = static_library('inotify', include_directories : [configinc, glibinc, gmoduleinc], dependencies : [gioenumtypes_dep, libglib_dep, libgobject_dep], pic : true, - c_args : [ '-DG_DISABLE_DEPRECATED' ] + gio_c_args) + c_args : gio_c_args) diff --git a/gio/kqueue/meson.build b/gio/kqueue/meson.build index e5057c83d1..d389b06f70 100644 --- a/gio/kqueue/meson.build +++ b/gio/kqueue/meson.build @@ -10,4 +10,4 @@ kqueue_lib = static_library('kqueue', include_directories : [configinc, glibinc, gmoduleinc], dependencies : [gioenumtypes_dep], pic : true, - c_args : [ '-DG_DISABLE_DEPRECATED' ] + gio_c_args) + c_args : gio_c_args) diff --git a/gio/win32/meson.build b/gio/win32/meson.build index f0fc307ba2..8d589989b2 100644 --- a/gio/win32/meson.build +++ b/gio/win32/meson.build @@ -12,4 +12,4 @@ giowin32_lib = static_library('giowin32', include_directories : [configinc, glibinc, gioinc, gmoduleinc], dependencies : [libintl, gioenumtypes_dep], pic : true, - c_args : [ '-DG_DISABLE_DEPRECATED' ] + gio_c_args) + c_args : gio_c_args) diff --git a/gmodule/meson.build b/gmodule/meson.build index e4a6a1c811..a7a2a5c87d 100644 --- a/gmodule/meson.build +++ b/gmodule/meson.build @@ -103,7 +103,7 @@ libgmodule = library('gmodule-2.0', install : true, include_directories : [configinc, gmoduleinc], dependencies : [libdl_dep, libglib_dep], - c_args : ['-DG_LOG_DOMAIN="GModule"', '-DG_DISABLE_DEPRECATED'] + glib_hidden_visibility_args, + c_args : ['-DG_LOG_DOMAIN="GModule"'] + glib_hidden_visibility_args, link_args : [glib_link_flags], ) -- GitLab From 40ff4759774516b7dff3b07303a98fc1626b2d0e Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 May 2019 19:50:09 +0100 Subject: [PATCH 14/14] Annotate various types and macros as deprecated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These have all been documented as deprecated for a long time, but we’ve never had a way to programmatically mark them as deprecated. Do that now. This is based on the list of deprecations from the reverted commit 80fcb1bc2. Signed-off-by: Philip Withnall Fixes: #638 --- gio/gasyncinitable.c | 4 ++-- gio/gasyncinitable.h | 4 ++++ gio/gdesktopappinfo.c | 4 ++++ gio/gdtlsconnection.c | 4 ++++ gio/gdtlsconnection.h | 2 ++ gio/ginitable.c | 4 ++-- gio/ginitable.h | 3 +++ gio/gioenums.h | 2 +- gio/gtlsconnection.c | 4 ++++ gio/gtlsconnection.h | 2 ++ glib/gslice.c | 2 ++ glib/gtestutils.c | 2 ++ glib/gtestutils.h | 6 ++++-- glib/gtrashstack.c | 3 +++ glib/gtrashstack.h | 8 ++++++-- gobject/gobject.c | 2 ++ gobject/gobject.h | 4 ++++ gobject/gparam.h | 4 ++-- gobject/gparamspecs.h | 6 +++--- gobject/gtype-private.h | 2 ++ gobject/gtype.c | 5 +++++ gobject/gtype.h | 7 +++++-- gobject/gvaluearray.h | 2 +- gobject/tests/private.c | 3 +++ 24 files changed, 72 insertions(+), 17 deletions(-) diff --git a/gio/gasyncinitable.c b/gio/gasyncinitable.c index bc5e40e7b9..8936f98b24 100644 --- a/gio/gasyncinitable.c +++ b/gio/gasyncinitable.c @@ -369,6 +369,7 @@ g_async_initable_new_async (GType object_type, * Deprecated: 2.54: Use g_object_new_with_properties() and * g_async_initable_init_async() instead. See #GParameter for more information. */ +G_GNUC_BEGIN_IGNORE_DEPRECATIONS void g_async_initable_newv_async (GType object_type, guint n_parameters, @@ -382,15 +383,14 @@ g_async_initable_newv_async (GType object_type, g_return_if_fail (G_TYPE_IS_ASYNC_INITABLE (object_type)); -G_GNUC_BEGIN_IGNORE_DEPRECATIONS obj = g_object_newv (object_type, n_parameters, parameters); -G_GNUC_END_IGNORE_DEPRECATIONS g_async_initable_init_async (G_ASYNC_INITABLE (obj), io_priority, cancellable, callback, user_data); g_object_unref (obj); /* Passed ownership to async call */ } +G_GNUC_END_IGNORE_DEPRECATIONS /** * g_async_initable_new_valist_async: diff --git a/gio/gasyncinitable.h b/gio/gasyncinitable.h index 8b05a22e78..1c713a13fb 100644 --- a/gio/gasyncinitable.h +++ b/gio/gasyncinitable.h @@ -95,6 +95,8 @@ void g_async_initable_new_async (GType object_type, gpointer user_data, const gchar *first_property_name, ...); + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS GLIB_DEPRECATED_IN_2_54_FOR(g_object_new_with_properties and g_async_initable_init_async) void g_async_initable_newv_async (GType object_type, guint n_parameters, @@ -103,6 +105,8 @@ void g_async_initable_newv_async (GType object_type, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +G_GNUC_END_IGNORE_DEPRECATIONS + GLIB_AVAILABLE_IN_ALL void g_async_initable_new_valist_async (GType object_type, const gchar *first_property_name, diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index ba2469af85..69018cfdd1 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -24,6 +24,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 #include diff --git a/gio/gdtlsconnection.c b/gio/gdtlsconnection.c index cbc25d4f26..ad8fe35483 100644 --- a/gio/gdtlsconnection.c +++ b/gio/gdtlsconnection.c @@ -638,6 +638,7 @@ g_dtls_connection_get_require_close_notify (GDtlsConnection *conn) * required for compatibility. Also, rehandshaking has been removed * from the TLS protocol in TLS 1.3. */ +G_GNUC_BEGIN_IGNORE_DEPRECATIONS void g_dtls_connection_set_rehandshake_mode (GDtlsConnection *conn, GTlsRehandshakeMode mode) @@ -648,6 +649,7 @@ g_dtls_connection_set_rehandshake_mode (GDtlsConnection *conn, "rehandshake-mode", mode, NULL); } +G_GNUC_END_IGNORE_DEPRECATIONS /** * g_dtls_connection_get_rehandshake_mode: @@ -660,6 +662,7 @@ g_dtls_connection_set_rehandshake_mode (GDtlsConnection *conn, * * Since: 2.48 */ +G_GNUC_BEGIN_IGNORE_DEPRECATIONS GTlsRehandshakeMode g_dtls_connection_get_rehandshake_mode (GDtlsConnection *conn) { @@ -672,6 +675,7 @@ g_dtls_connection_get_rehandshake_mode (GDtlsConnection *conn) NULL); return mode; } +G_GNUC_END_IGNORE_DEPRECATIONS /** * g_dtls_connection_handshake: diff --git a/gio/gdtlsconnection.h b/gio/gdtlsconnection.h index 364be935e9..3901cdc9ec 100644 --- a/gio/gdtlsconnection.h +++ b/gio/gdtlsconnection.h @@ -129,11 +129,13 @@ void g_dtls_connection_set_require_close_notify (GDtlsConnec GLIB_AVAILABLE_IN_2_48 gboolean g_dtls_connection_get_require_close_notify (GDtlsConnection *conn); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS GLIB_DEPRECATED_IN_2_60 void g_dtls_connection_set_rehandshake_mode (GDtlsConnection *conn, GTlsRehandshakeMode mode); GLIB_DEPRECATED_IN_2_60 GTlsRehandshakeMode g_dtls_connection_get_rehandshake_mode (GDtlsConnection *conn); +G_GNUC_END_IGNORE_DEPRECATIONS GLIB_AVAILABLE_IN_2_48 gboolean g_dtls_connection_handshake (GDtlsConnection *conn, diff --git a/gio/ginitable.c b/gio/ginitable.c index b5b5006185..f3fd76ffcc 100644 --- a/gio/ginitable.c +++ b/gio/ginitable.c @@ -187,6 +187,7 @@ g_initable_new (GType object_type, * Deprecated: 2.54: Use g_object_new_with_properties() and * g_initable_init() instead. See #GParameter for more information. */ +G_GNUC_BEGIN_IGNORE_DEPRECATIONS gpointer g_initable_newv (GType object_type, guint n_parameters, @@ -198,9 +199,7 @@ g_initable_newv (GType object_type, g_return_val_if_fail (G_TYPE_IS_INITABLE (object_type), NULL); -G_GNUC_BEGIN_IGNORE_DEPRECATIONS obj = g_object_newv (object_type, n_parameters, parameters); -G_GNUC_END_IGNORE_DEPRECATIONS if (!g_initable_init (G_INITABLE (obj), cancellable, error)) { @@ -210,6 +209,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS return (gpointer)obj; } +G_GNUC_END_IGNORE_DEPRECATIONS /** * g_initable_new_valist: diff --git a/gio/ginitable.h b/gio/ginitable.h index c29098d53b..3124f028f0 100644 --- a/gio/ginitable.h +++ b/gio/ginitable.h @@ -81,12 +81,15 @@ gpointer g_initable_new (GType object_type, const gchar *first_property_name, ...); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS GLIB_DEPRECATED_IN_2_54_FOR(g_object_new_with_properties and g_initable_init) gpointer g_initable_newv (GType object_type, guint n_parameters, GParameter *parameters, GCancellable *cancellable, GError **error); +G_GNUC_END_IGNORE_DEPRECATIONS + GLIB_AVAILABLE_IN_ALL GObject* g_initable_new_valist (GType object_type, const gchar *first_property_name, diff --git a/gio/gioenums.h b/gio/gioenums.h index d3ada454aa..22fe7005c1 100644 --- a/gio/gioenums.h +++ b/gio/gioenums.h @@ -1628,7 +1628,7 @@ typedef enum { G_TLS_REHANDSHAKE_NEVER, G_TLS_REHANDSHAKE_SAFELY, G_TLS_REHANDSHAKE_UNSAFELY -} GTlsRehandshakeMode; +} GTlsRehandshakeMode GLIB_DEPRECATED_TYPE_IN_2_60; /** * GTlsPasswordFlags: diff --git a/gio/gtlsconnection.c b/gio/gtlsconnection.c index 02a3098c19..3942f65e34 100644 --- a/gio/gtlsconnection.c +++ b/gio/gtlsconnection.c @@ -754,6 +754,7 @@ g_tls_connection_get_require_close_notify (GTlsConnection *conn) * required for compatibility. Also, rehandshaking has been removed * from the TLS protocol in TLS 1.3. */ +G_GNUC_BEGIN_IGNORE_DEPRECATIONS void g_tls_connection_set_rehandshake_mode (GTlsConnection *conn, GTlsRehandshakeMode mode) @@ -764,6 +765,7 @@ g_tls_connection_set_rehandshake_mode (GTlsConnection *conn, "rehandshake-mode", mode, NULL); } +G_GNUC_END_IGNORE_DEPRECATIONS /** * g_tls_connection_get_rehandshake_mode: @@ -780,6 +782,7 @@ g_tls_connection_set_rehandshake_mode (GTlsConnection *conn, * required for compatibility. Also, rehandshaking has been removed * from the TLS protocol in TLS 1.3. */ +G_GNUC_BEGIN_IGNORE_DEPRECATIONS GTlsRehandshakeMode g_tls_connection_get_rehandshake_mode (GTlsConnection *conn) { @@ -792,6 +795,7 @@ g_tls_connection_get_rehandshake_mode (GTlsConnection *conn) NULL); return mode; } +G_GNUC_END_IGNORE_DEPRECATIONS /** * g_tls_connection_set_advertised_protocols: diff --git a/gio/gtlsconnection.h b/gio/gtlsconnection.h index 39ec3fa025..be38dcf5c9 100644 --- a/gio/gtlsconnection.h +++ b/gio/gtlsconnection.h @@ -109,11 +109,13 @@ void g_tls_connection_set_require_close_notify (GTlsConnecti GLIB_AVAILABLE_IN_ALL gboolean g_tls_connection_get_require_close_notify (GTlsConnection *conn); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS GLIB_DEPRECATED_IN_2_60 void g_tls_connection_set_rehandshake_mode (GTlsConnection *conn, GTlsRehandshakeMode mode); GLIB_DEPRECATED_IN_2_60 GTlsRehandshakeMode g_tls_connection_get_rehandshake_mode (GTlsConnection *conn); +G_GNUC_END_IGNORE_DEPRECATIONS GLIB_AVAILABLE_IN_2_60 void g_tls_connection_set_advertised_protocols (GTlsConnection *conn, diff --git a/glib/gslice.c b/glib/gslice.c index 0e17261381..7239bab3a1 100644 --- a/glib/gslice.c +++ b/glib/gslice.c @@ -1397,7 +1397,9 @@ slab_allocator_free_chunk (gsize chunk_size, */ #if !(HAVE_POSIX_MEMALIGN || HAVE_MEMALIGN || HAVE_VALLOC) +G_GNUC_BEGIN_IGNORE_DEPRECATIONS static GTrashStack *compat_valloc_trash = NULL; +G_GNUC_END_IGNORE_DEPRECATIONS #endif static gpointer diff --git a/glib/gtestutils.c b/glib/gtestutils.c index abdaaa6071..ecef563b74 100644 --- a/glib/gtestutils.c +++ b/glib/gtestutils.c @@ -3268,6 +3268,7 @@ wait_for_child (GPid pid, * and is not always reliable due to problems inherent in * fork-without-exec. Use g_test_trap_subprocess() instead. */ +G_GNUC_BEGIN_IGNORE_DEPRECATIONS gboolean g_test_trap_fork (guint64 usec_timeout, GTestTrapFlags test_trap_flags) @@ -3330,6 +3331,7 @@ g_test_trap_fork (guint64 usec_timeout, return FALSE; #endif } +G_GNUC_END_IGNORE_DEPRECATIONS /** * g_test_trap_subprocess: diff --git a/glib/gtestutils.h b/glib/gtestutils.h index 7a0715c82e..114d0554bc 100644 --- a/glib/gtestutils.h +++ b/glib/gtestutils.h @@ -356,7 +356,7 @@ void g_test_queue_destroy (GDestroyNotify destroy_func, * Test traps are guards around forked tests. * These flags determine what traps to set. * - * Deprecated: #GTestTrapFlags is used only with g_test_trap_fork(), + * Deprecated: 2.38: #GTestTrapFlags is used only with g_test_trap_fork(), * which is deprecated. g_test_trap_subprocess() uses * #GTestSubprocessFlags. */ @@ -364,11 +364,13 @@ typedef enum { G_TEST_TRAP_SILENCE_STDOUT = 1 << 7, G_TEST_TRAP_SILENCE_STDERR = 1 << 8, G_TEST_TRAP_INHERIT_STDIN = 1 << 9 -} GTestTrapFlags; +} GTestTrapFlags GLIB_DEPRECATED_TYPE_IN_2_38_FOR(GTestSubprocessFlags); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS GLIB_DEPRECATED_IN_2_38_FOR (g_test_trap_subprocess) gboolean g_test_trap_fork (guint64 usec_timeout, GTestTrapFlags test_trap_flags); +G_GNUC_END_IGNORE_DEPRECATIONS typedef enum { G_TEST_SUBPROCESS_INHERIT_STDIN = 1 << 0, diff --git a/glib/gtrashstack.c b/glib/gtrashstack.c index 02599d6328..8d5226840d 100644 --- a/glib/gtrashstack.c +++ b/glib/gtrashstack.c @@ -24,6 +24,9 @@ #include "config.h" +/* we know we are deprecated here, no need for warnings */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #include "gtrashstack.h" /** diff --git a/glib/gtrashstack.h b/glib/gtrashstack.h index 44b3c6c101..0730ec296a 100644 --- a/glib/gtrashstack.h +++ b/glib/gtrashstack.h @@ -33,11 +33,13 @@ G_BEGIN_DECLS -typedef struct _GTrashStack GTrashStack; +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +typedef struct _GTrashStack GTrashStack GLIB_DEPRECATED_TYPE_IN_2_48; struct _GTrashStack { GTrashStack *next; -}; +} GLIB_DEPRECATED_TYPE_IN_2_48; GLIB_DEPRECATED_IN_2_48 void g_trash_stack_push (GTrashStack **stack_p, @@ -49,6 +51,8 @@ gpointer g_trash_stack_peek (GTrashStack **stack_p); GLIB_DEPRECATED_IN_2_48 guint g_trash_stack_height (GTrashStack **stack_p); +G_GNUC_END_IGNORE_DEPRECATIONS + G_END_DECLS #endif /* __G_TRASH_STACK_H_ */ diff --git a/gobject/gobject.c b/gobject/gobject.c index c95311b3e7..e243664fd1 100644 --- a/gobject/gobject.c +++ b/gobject/gobject.c @@ -2017,6 +2017,7 @@ g_object_new_with_properties (GType object_type, * Deprecated: 2.54: Use g_object_new_with_properties() instead. * deprecated. See #GParameter for more information. */ +G_GNUC_BEGIN_IGNORE_DEPRECATIONS gpointer g_object_newv (GType object_type, guint n_parameters, @@ -2068,6 +2069,7 @@ g_object_newv (GType object_type, return object; } +G_GNUC_END_IGNORE_DEPRECATIONS /** * g_object_new_valist: (skip) diff --git a/gobject/gobject.h b/gobject/gobject.h index b5648f137e..5f5c2a944c 100644 --- a/gobject/gobject.h +++ b/gobject/gobject.h @@ -424,10 +424,14 @@ GObject* g_object_new_with_properties (GType object_type, guint n_properties, const char *names[], const GValue values[]); + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS GLIB_DEPRECATED_IN_2_54_FOR(g_object_new_with_properties) gpointer g_object_newv (GType object_type, guint n_parameters, GParameter *parameters); +G_GNUC_END_IGNORE_DEPRECATIONS + GLIB_AVAILABLE_IN_ALL GObject* g_object_new_valist (GType object_type, const gchar *first_property_name, diff --git a/gobject/gparam.h b/gobject/gparam.h index 97a90dbe43..33f95f0c5c 100644 --- a/gobject/gparam.h +++ b/gobject/gparam.h @@ -191,7 +191,7 @@ typedef enum /* --- typedefs & structures --- */ typedef struct _GParamSpec GParamSpec; typedef struct _GParamSpecClass GParamSpecClass; -typedef struct _GParameter GParameter; +typedef struct _GParameter GParameter GLIB_DEPRECATED_TYPE_IN_2_54; typedef struct _GParamSpecPool GParamSpecPool; /** * GParamSpec: (ref-func g_param_spec_ref_sink) (unref-func g_param_spec_uref) (set-value-func g_value_set_param) (get-value-func g_value_get_param) @@ -272,7 +272,7 @@ struct _GParameter /* auxiliary structure for _setv() variants */ { const gchar *name; GValue value; -}; +} GLIB_DEPRECATED_TYPE_IN_2_54; /* --- prototypes --- */ diff --git a/gobject/gparamspecs.h b/gobject/gparamspecs.h index 26045a3682..0309f9bb34 100644 --- a/gobject/gparamspecs.h +++ b/gobject/gparamspecs.h @@ -452,7 +452,7 @@ G_BEGIN_DECLS * * Deprecated: 2.32: Use #GArray instead of #GValueArray */ -#define G_TYPE_PARAM_VALUE_ARRAY (g_param_spec_types[18]) +#define G_TYPE_PARAM_VALUE_ARRAY (g_param_spec_types[18]) GLIB_DEPRECATED_MACRO_IN_2_32 /** * G_IS_PARAM_SPEC_VALUE_ARRAY: * @pspec: a valid #GParamSpec instance @@ -463,7 +463,7 @@ G_BEGIN_DECLS * * Deprecated: 2.32: Use #GArray instead of #GValueArray */ -#define G_IS_PARAM_SPEC_VALUE_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_VALUE_ARRAY)) +#define G_IS_PARAM_SPEC_VALUE_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_VALUE_ARRAY)) GLIB_DEPRECATED_MACRO_IN_2_32 /** * G_PARAM_SPEC_VALUE_ARRAY: * @pspec: a valid #GParamSpec instance @@ -472,7 +472,7 @@ G_BEGIN_DECLS * * Deprecated: 2.32: Use #GArray instead of #GValueArray */ -#define G_PARAM_SPEC_VALUE_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_VALUE_ARRAY, GParamSpecValueArray)) +#define G_PARAM_SPEC_VALUE_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_VALUE_ARRAY, GParamSpecValueArray)) GLIB_DEPRECATED_MACRO_IN_2_32 /** * G_TYPE_PARAM_OBJECT: diff --git a/gobject/gtype-private.h b/gobject/gtype-private.h index 5f2f13b47a..230dba03a2 100644 --- a/gobject/gtype-private.h +++ b/gobject/gtype-private.h @@ -44,7 +44,9 @@ G_STMT_START { \ G_BEGIN_DECLS +G_GNUC_BEGIN_IGNORE_DEPRECATIONS extern GTypeDebugFlags _g_type_debug_flags; +G_GNUC_END_IGNORE_DEPRECATIONS typedef struct _GRealClosure GRealClosure; struct _GRealClosure diff --git a/gobject/gtype.c b/gobject/gtype.c index 67a1eda8ba..425c6195d1 100644 --- a/gobject/gtype.c +++ b/gobject/gtype.c @@ -380,7 +380,10 @@ static GQuark static_quark_type_flags = 0; static GQuark static_quark_iface_holder = 0; static GQuark static_quark_dependants_array = 0; static guint type_registration_serial = 0; + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS GTypeDebugFlags _g_type_debug_flags = 0; +G_GNUC_END_IGNORE_DEPRECATIONS /* --- type nodes --- */ static GHashTable *static_type_nodes_ht = NULL; @@ -4332,6 +4335,7 @@ _g_type_boxed_init (GType type, * * Deprecated: 2.36: the type system is now initialised automatically */ +G_GNUC_BEGIN_IGNORE_DEPRECATIONS void g_type_init_with_debug_flags (GTypeDebugFlags debug_flags) { @@ -4340,6 +4344,7 @@ g_type_init_with_debug_flags (GTypeDebugFlags debug_flags) if (debug_flags) g_message ("g_type_init_with_debug_flags() is no longer supported. Use the GOBJECT_DEBUG environment variable."); } +G_GNUC_END_IGNORE_DEPRECATIONS /** * g_type_init: diff --git a/gobject/gtype.h b/gobject/gtype.h index a3a07c6a3c..e646bf9d31 100644 --- a/gobject/gtype.h +++ b/gobject/gtype.h @@ -638,7 +638,7 @@ struct _GTypeQuery * `your_type_get_instance_private()` function instead * Returns: (not nullable): a pointer to the private data structure */ -#define G_TYPE_INSTANCE_GET_PRIVATE(instance, g_type, c_type) ((c_type*) g_type_instance_get_private ((GTypeInstance*) (instance), (g_type))) +#define G_TYPE_INSTANCE_GET_PRIVATE(instance, g_type, c_type) ((c_type*) g_type_instance_get_private ((GTypeInstance*) (instance), (g_type))) GLIB_DEPRECATED_MACRO_IN_2_58_FOR(G_ADD_PRIVATE) /** * G_TYPE_CLASS_GET_PRIVATE: @@ -680,14 +680,17 @@ typedef enum /*< skip >*/ G_TYPE_DEBUG_SIGNALS = 1 << 1, G_TYPE_DEBUG_INSTANCE_COUNT = 1 << 2, G_TYPE_DEBUG_MASK = 0x07 -} GTypeDebugFlags; +} GTypeDebugFlags GLIB_DEPRECATED_TYPE_IN_2_36; /* --- prototypes --- */ +G_GNUC_BEGIN_IGNORE_DEPRECATIONS GLIB_DEPRECATED_IN_2_36 void g_type_init (void); GLIB_DEPRECATED_IN_2_36 void g_type_init_with_debug_flags (GTypeDebugFlags debug_flags); +G_GNUC_END_IGNORE_DEPRECATIONS + GLIB_AVAILABLE_IN_ALL const gchar * g_type_name (GType type); GLIB_AVAILABLE_IN_ALL diff --git a/gobject/gvaluearray.h b/gobject/gvaluearray.h index d8b6bb55c8..dbc6be765d 100644 --- a/gobject/gvaluearray.h +++ b/gobject/gvaluearray.h @@ -35,7 +35,7 @@ G_BEGIN_DECLS * * Deprecated: 2.32: Use #GArray instead of #GValueArray */ -#define G_TYPE_VALUE_ARRAY (g_value_array_get_type ()) +#define G_TYPE_VALUE_ARRAY (g_value_array_get_type ()) GLIB_DEPRECATED_MACRO_IN_2_32_FOR(G_TYPE_ARRAY) /* --- typedefs & structs --- */ typedef struct _GValueArray GValueArray; diff --git a/gobject/tests/private.c b/gobject/tests/private.c index 6782221905..ee8fd8f458 100644 --- a/gobject/tests/private.c +++ b/gobject/tests/private.c @@ -1,3 +1,6 @@ +/* We are testing some deprecated APIs here */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #include typedef struct { -- GitLab