HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SYS_Deprecated.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: SYS_Deprecated.h (SYS Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __SYS_DEPRECATED_H_INCLUDED__
12 #define __SYS_DEPRECATED_H_INCLUDED__
13 
14 #include "SYS_Pragma.h"
15 
16 /// Mark function as deprecated and may be removed in the future.
17 /// @note This qualifier can only appear in function declarations.
18 #if defined(GCC3)
19 # if SYS_IS_GCC_GE(4, 6) || defined(__clang__)
20 # define SYS_DEPRECATED(__V__) \
21  __attribute__ ((deprecated("Deprecated since version " #__V__)))
22 # define SYS_DEPRECATED_REPLACE(__V__, __R__) \
23  __attribute__ ((deprecated("Deprecated since version " \
24  SYS_TO_STRING(__V__) ". Use '" \
25  SYS_TO_STRING(__R__) "' instead.")))
26 # else
27 # define SYS_DEPRECATED(__V__) __attribute__ ((deprecated))
28 # define SYS_DEPRECATED_REPLACE(__V__, __R__) __attribute__ ((deprecated))
29 # endif
30 #elif defined(_MSC_VER)
31 # define SYS_DEPRECATED(__V__) \
32  __declspec(deprecated("Deprecated since version " #__V__))
33 # define SYS_DEPRECATED_REPLACE(__V__, __R__) \
34  __declspec(deprecated("Deprecated since version " \
35  SYS_TO_STRING(__V__) ". Use " \
36  SYS_TO_STRING(__R__) " instead."))
37 #else
38 # define SYS_DEPRECATED(__V__)
39 # define SYS_DEPRECATED_REPLACE(__V__, __R__)
40 #endif
41 
42 
43 #if !defined(IGNORE_HDK_DEPRECATIONS)
44 # define SYS_DEPRECATED_HDK(__V__) SYS_DEPRECATED(__V__)
45 # define SYS_DEPRECATED_HDK_REPLACE(__V__,__R__) \
46  SYS_DEPRECATED_REPLACE(__V__, __R__)
47 #else
48 # define SYS_DEPRECATED_HDK(__V__)
49 # define SYS_DEPRECATED_HDK_REPLACE(__V__, __R__)
50 #endif
51 
52 /// Temporarily disable deprecation warnings. The PUSH/POPs must match!
53 /// @note Only implemented for Visual C++ and gcc 4.6
54 #if defined(_MSC_VER) || SYS_IS_GCC_GE(4, 6) || defined(__clang__)
55 #define SYS_DEPRECATED_PUSH_DISABLE() SYS_PRAGMA_PUSH_WARN() \
56  SYS_PRAGMA_DISABLE_DEPRECATED() \
57  /**/
58 #define SYS_DEPRECATED_POP_DISABLE() SYS_PRAGMA_POP_WARN()
59 #else
60 /// Hopefully this works sufficiently to locally disable deprecation
61 /// warnings in GCC 4.4 and before.
62 #define SYS_DEPRECATED_PUSH_DISABLE() \
63  SYS_PRAGMA(GCC diagnostic ignored "-Wdeprecated-declarations")
64 #define SYS_DEPRECATED_POP_DISABLE() \
65  SYS_PRAGMA(GCC diagnostic warning "-Wdeprecated-declarations")
66 #endif
67 
68 #endif // __SYS_DEPRECATED_H_INCLUDED__