[protocol v4 1/2] macros: Use GLib's G_DEPRECATED macro if available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This gains us automatic support for whichever compilers GLib supports in
this macro when used in projects that use GLib.

Signed-off-by: Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
---

Resending since I still don't see this in the repository and I forgot to 
adjust the #endif in v3.


 spice/macros.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/spice/macros.h b/spice/macros.h
index a0413f3..ae11b3c 100644
--- a/spice/macros.h
+++ b/spice/macros.h
@@ -78,11 +78,13 @@
 #define SPICE_GNUC_NO_INSTRUMENT
 #endif  /* !__GNUC__ */
 
-#if    __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+#ifdef G_DEPRECATED
+#define SPICE_GNUC_DEPRECATED  G_DEPRECATED
+#elif  __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
 #define SPICE_GNUC_DEPRECATED  __attribute__((__deprecated__))
 #else
 #define SPICE_GNUC_DEPRECATED
-#endif /* __GNUC__ */
+#endif
 
 #if     __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
 #  define SPICE_GNUC_MAY_ALIAS __attribute__((may_alias))
-- 
2.10.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]