lavu: provide msvc implementation of attribute_deprecated
authorKirill Gavrilov <kirill@sview.ru>
Fri, 6 Sep 2013 17:32:31 +0000 (21:32 +0400)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 6 Sep 2013 20:15:33 +0000 (22:15 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/attributes.h

index 64b46f6..159e75d 100644 (file)
@@ -86,6 +86,8 @@
 
 #if AV_GCC_VERSION_AT_LEAST(3,1)
 #    define attribute_deprecated __attribute__((deprecated))
+#elif defined(_MSC_VER)
+#    define attribute_deprecated __declspec(deprecated)
 #else
 #    define attribute_deprecated
 #endif
         _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
         code \
         _Pragma("GCC diagnostic pop")
+#elif defined(_MSC_VER)
+#    define AV_NOWARN_DEPRECATED(code) \
+        __pragma(warning(push)) \
+        __pragma(warning(disable : 4996)) \
+        code; \
+        __pragma(warning(pop))
 #else
 #    define AV_NOWARN_DEPRECATED(code) code
 #endif