From 6fb336e5218e85ca20010ba1f36092dcef955d92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 4 Sep 2012 23:27:05 +0200 Subject: [PATCH spice-gtk] G_GNUC_DEPRECATED_FOR must be defined publicly It's not enough to define G_GNUC_DEPRECATED_FOR in glib-compat.h, since this header is no public. Instead, let's define our own SPICE_DEPRECATED_FOR macro --- gtk/glib-compat.h | 16 ---------------- gtk/spice-util.h | 12 +++++++++++- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/gtk/glib-compat.h b/gtk/glib-compat.h index a9efda3..909b4e1 100644 --- a/gtk/glib-compat.h +++ b/gtk/glib-compat.h @@ -67,13 +67,6 @@ type_name##_get_type (void) \ #define G_TYPE_ERROR (spice_error_get_type ()) GType spice_error_get_type (void) G_GNUC_CONST; -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) -#define G_GNUC_DEPRECATED_FOR(f) \ - __attribute__((deprecated("Use " #f " instead"))) -#else -#define G_GNUC_DEPRECATED_FOR(f) G_GNUC_DEPRECATED -#endif /* __GNUC__ */ - #define G_PARAM_DEPRECATED (1 << 31) #endif /* glib 2.26 */ @@ -126,13 +119,4 @@ GType spice_main_context_get_type (void) G_GNUC_CONST; } G_STMT_END #endif -#ifndef G_GNUC_DEPRECATED_FOR -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) -#define G_GNUC_DEPRECATED_FOR(f) \ - __attribute__((deprecated("Use " #f " instead"))) -#else -#define G_GNUC_DEPRECATED_FOR(f) G_GNUC_DEPRECATED -#endif /* __GNUC__ */ -#endif - #endif /* GLIB_COMPAT_H */ diff --git a/gtk/spice-util.h b/gtk/spice-util.h index 271f3be..6996e55 100644 --- a/gtk/spice-util.h +++ b/gtk/spice-util.h @@ -39,8 +39,18 @@ gulong spice_g_signal_connect_object(gpointer instance, #define SPICE_RESERVED_PADDING (10 * sizeof(void*)) +/* need to be in a public header, glib-compat.h is private */ +#ifndef SPICE_GNUC_DEPRECATED_FOR +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +#define SPICE_GNUC_DEPRECATED_FOR(f) \ + __attribute__((deprecated("Use " #f " instead"))) +#else +#define SPICE_GNUC_DEPRECATED_FOR(f) G_GNUC_DEPRECATED +#endif /* __GNUC__ */ +#endif + #ifndef SPICE_NO_DEPRECATED -#define SPICE_DEPRECATED_FOR(f) G_GNUC_DEPRECATED_FOR(f) +#define SPICE_DEPRECATED_FOR(f) SPICE_GNUC_DEPRECATED_FOR(f) #define SPICE_DEPRECATED G_GNUC_DEPRECATED #else #define SPICE_DEPRECATED_FOR(f) -- 1.7.11.4