[Spice-devel] [protocol v4 2/2] macros: Add MSVC support to SPICE_GNUC_DEPRECATED

Francois Gouget fgouget at codeweavers.com
Mon Nov 21 18:34:01 UTC 2016


Based on the G_DEPRECATED GLib macro.
For projects that don't use GLib.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 spice/macros.h | 2 ++
 1 file changed, 2 insertions(+)

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


More information about the Spice-devel mailing list