Go to the documentation of this file.
10 #ifndef vtk_m_Deprecated_h
11 #define vtk_m_Deprecated_h
16 #define VTK_M_DEPRECATED_MAKE_MESSAGE(...) \
17 VTKM_EXPAND(VTK_M_DEPRECATED_MAKE_MESSAGE_IMPL(__VA_ARGS__, "", vtkm::internal::NullType{}))
18 #define VTK_M_DEPRECATED_MAKE_MESSAGE_IMPL(version, message, ...) \
19 message " Deprecated in version " #version "."
61 #ifndef VTK_M_DEPRECATED_ATTRIBUTE_SUPPORTED
65 #elif __cplusplus >= 201402L && !defined(VTKM_GCC)
70 #define VTK_M_DEPRECATED_ATTRIBUTE_SUPPORTED
72 #elif defined(VTKM_GCC)
77 #define VTK_M_DEPRECATED_ATTRIBUTE_SUPPORTED
80 #elif defined(__has_cpp_attribute)
82 #if __has_cpp_attribute(deprecated)
84 #define VTK_M_DEPRECATED_ATTRIBUTE_SUPPORTED
85 #endif // __has_cpp_attribute(deprecated)
87 #elif defined(VTKM_MSVC) && (_MSC_VER >= 1920)
89 #define VTK_M_DEPRECATED_ATTRIBUTE_SUPPORTED
91 #endif // no known compiler support for [[deprecated]]
93 #endif // VTK_M_DEPRECATED_ATTRIBUTE_SUPPORTED check
102 #ifndef VTKM_DEPRECATED_SUPPRESS_SUPPORTED
104 #if defined(VTKM_GCC) || defined(VTKM_CLANG)
106 #define VTKM_DEPRECATED_SUPPRESS_SUPPORTED
107 #define VTKM_DEPRECATED_SUPPRESS_BEGIN \
108 _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
109 #define VTKM_DEPRECATED_SUPPRESS_END _Pragma("GCC diagnostic pop")
111 #elif defined(VTKM_MSVC)
113 #define VTKM_DEPRECATED_SUPPRESS_SUPPORTED
114 #define VTKM_DEPRECATED_SUPPRESS_BEGIN __pragma(warning(push)) __pragma(warning(disable : 4996))
115 #define VTKM_DEPRECATED_SUPPRESS_END __pragma(warning(pop))
122 #define VTKM_DEPRECATED_SUPPRESS_BEGIN
123 #define VTKM_DEPRECATED_SUPPRESS_END
127 #endif // VTKM_DEPRECATED_SUPPRESS_SUPPORTED check
129 #if !defined(VTKM_DEPRECATED_SUPPRESS_BEGIN) || !defined(VTKM_DEPRECATED_SUPPRESS_END)
130 #error VTKM_DEPRECATED_SUPPRESS macros not properly defined.
135 #if defined(VTK_M_DEPRECATED_ATTRIBUTE_SUPPORTED) && defined(VTKM_DEPRECATED_SUPPRESS_SUPPORTED)
137 #define VTKM_DEPRECATED(...) [[deprecated(VTK_M_DEPRECATED_MAKE_MESSAGE(__VA_ARGS__))]]
142 #define VTKM_DEPRECATED(...) __attribute__((deprecated(VTK_M_DEPRECATED_MAKE_MESSAGE(__VA_ARGS__))))
145 #define VTKM_DEPRECATED(...)
148 #endif // vtk_m_Deprecated_h