[Spice-commits] gtk/glib-compat.h gtk/spice-util.h

Christophe Fergau teuf at kemper.freedesktop.org
Tue Sep 25 01:14:30 PDT 2012


 gtk/glib-compat.h |   16 ----------------
 gtk/spice-util.h  |   12 +++++++++++-
 2 files changed, 11 insertions(+), 17 deletions(-)

New commits:
commit d381edc33d0f40b6eec816867403b36d58d01635
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date:   Fri Sep 7 16:59:31 2012 +0200

    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 not public. Instead, let's define our own
    public SPICE_DEPRECATED_FOR macro, and clean-up double definition.

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)


More information about the Spice-commits mailing list