diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-09-07 12:37:08 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-09-07 14:56:11 +0200 |
commit | de290e726ed2aa5a4c007d61a7db1042c45d43db (patch) | |
tree | eadecfe4a3d2d6d33fc4b0bad08f3b2267eb2a71 /sal | |
parent | This seems to help the MSVC build along (diff) | |
download | core-de290e726ed2aa5a4c007d61a7db1042c45d43db.tar.gz core-de290e726ed2aa5a4c007d61a7db1042c45d43db.zip |
introduce SAL_DEPRECATED macro
Diffstat (limited to 'sal')
-rw-r--r-- | sal/inc/sal/types.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h index a89b9e2f85fb..ba7655be785c 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: */ |