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

Submitted by Francois Gouget on Nov. 21, 2016, 6:24 p.m.

Details

Message ID 8ae65a914138fea29661ba4842bc6cf2c80cd0ae.1479752641.git.fgouget@free.fr
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Francois Gouget Nov. 21, 2016, 6:24 p.m.
Based on the G_DEPRECATED GLib macro.

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

Patch hide | download patch | download mbox

diff --git a/spice/macros.h b/spice/macros.h
index 42916b9..684bfc2 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 /* __GNUC__ */