[Libreoffice-commits] .: sal/inc

Bjoern Michaelsen bmichaelsen at kemper.freedesktop.org
Wed Sep 7 05:56:47 PDT 2011


 sal/inc/sal/types.h |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit de290e726ed2aa5a4c007d61a7db1042c45d43db
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Wed Sep 7 12:37:08 2011 +0200

    introduce SAL_DEPRECATED macro

diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h
index a89b9e2..ba7655b 100644
--- a/sal/inc/sal/types.h
+++ b/sal/inc/sal/types.h
@@ -440,6 +440,22 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) {
 
 #endif /* __cplusplus */
 
+/**
+    Use as follows:
+        void SAL_DEPRECATED(doit(int nPara), "Dont use, its evil.");
+    note that currently a c++0x compatible gcc disables deprecation warnings
+*/
+
+#if (__GNUC__ > 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
+#    define SAL_DEPRECATED(func,message)  func __attribute__((deprecated(message)))
+#elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
+#    define SAL_DEPRECATED(func,message)  func __attribute__((deprecated))
+#elif defined(_MSC_VER)
+#    define SAL_DEPRECATED(func,message)  __declspec(deprecated(message)) func
+#else
+#    define SAL_DEPRECATED(func,message)
+#endif
+
 #endif /*_SAL_TYPES_H_ */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list