[Spice-commits] 2 commits - spice/macros.h

Christophe Fergau teuf at kemper.freedesktop.org
Wed Nov 23 08:13:40 UTC 2016


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

New commits:
commit b1cdb2756f350ade8d5b425dec85f8207ed39a0d
Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Mon Nov 21 19:34:01 2016 +0100

    macros: Add MSVC support to SPICE_GNUC_DEPRECATED
    
    Based on the G_DEPRECATED GLib macro.
    For projects that don't use GLib.
    
    Signed-off-by: Francois Gouget <fgouget at codeweavers.com>

diff --git a/spice/macros.h b/spice/macros.h
index ae11b3c..1f8a5c8 100644
--- a/spice/macros.h
+++ b/spice/macros.h
@@ -82,6 +82,8 @@
 #define SPICE_GNUC_DEPRECATED  G_DEPRECATED
 #elif  __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
 #define SPICE_GNUC_DEPRECATED  __attribute__((__deprecated__))
+#elif defined(_MSC_VER) && (_MSC_VER >= 1300)
+#define SPICE_GNUC_DEPRECATED  __declspec(deprecated)
 #else
 #define SPICE_GNUC_DEPRECATED
 #endif
commit 0d7aa7579e54e2dd92cd047df418034f2f246bf3
Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Mon Nov 21 19:30:50 2016 +0100

    macros: Use GLib's G_DEPRECATED macro if available
    
    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 at codeweavers.com>

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))


More information about the Spice-commits mailing list