VTK  9.0.20200925
vtkDeprecation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDeprecation.h
5 
6 -------------------------------------------------------------------------
7  Copyright 2008 Sandia Corporation.
8  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9  the U.S. Government retains certain rights in this software.
10 -------------------------------------------------------------------------
11 
12  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13  All rights reserved.
14  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
15 
16  This software is distributed WITHOUT ANY WARRANTY; without even
17  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18  PURPOSE. See the above copyright notice for more information.
19 
20 =========================================================================*/
21 
22 #ifndef vtkDeprecated_h
23 #define vtkDeprecated_h
24 
25 #include "vtkVersion.h"
26 
27 // The level at which warnings should be made.
28 #ifndef VTK_DEPRECATION_LEVEL
29 // VTK defaults to deprecation of its current version.
30 #include "vtkVersionMacros.h"
31 #define VTK_DEPRECATION_LEVEL VTK_VERSION_NUMBER
32 #endif
33 
34 // API deprecated before 8.2.0 have already been removed.
35 #define VTK_MINIMUM_DEPRECATION_LEVEL VTK_VERSION_CHECK(8, 2, 0)
36 
37 // Force the deprecation level to be at least that of VTK's build
38 // configuration.
39 #if VTK_DEPRECATION_LEVEL < VTK_MINIMUM_DEPRECATION_LEVEL
40 #undef VTK_DEPRECATION_LEVEL
41 #define VTK_DEPRECATION_LEVEL VTK_MINIMUM_DEPRECATION_LEVEL
42 #endif
43 
44 // Deprecation macro support for various compilers.
45 #if 0 && __cplusplus >= 201402L
46 // This is currently hard-disabled because compilers do not mix C++ attributes
47 // and `__attribute__` extensions together well.
48 #define VTK_DEPRECATION(reason) [[deprecated(reason)]]
49 #elif defined(VTK_WRAPPING_CXX)
50 // Ignore deprecation in wrapper code.
51 #define VTK_DEPRECATION(reason)
52 #elif defined(__VTK_WRAP__)
53 #define VTK_DEPRECATION(reason) [[vtk::deprecated(reason)]]
54 #else
55 #if defined(_WIN32) || defined(_WIN64)
56 #define VTK_DEPRECATION(reason) __declspec(deprecated(reason))
57 #elif defined(__clang__)
58 #if __has_extension(attribute_deprecated_with_message)
59 #define VTK_DEPRECATION(reason) __attribute__((__deprecated__(reason)))
60 #else
61 #define VTK_DEPRECATION(reason) __attribute__((__deprecated__))
62 #endif
63 #elif defined(__GNUC__)
64 #if (__GNUC__ >= 5) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5))
65 #define VTK_DEPRECATION(reason) __attribute__((__deprecated__(reason)))
66 #else
67 #define VTK_DEPRECATION(reason) __attribute__((__deprecated__))
68 #endif
69 #else
70 #define VTK_DEPRECATION(reason)
71 #endif
72 #endif
73 
74 // APIs deprecated in the next release.
75 #if VTK_DEPRECATION_LEVEL >= VTK_VERSION_CHECK(9, 1, 0)
76 #define VTK_DEPRECATED_IN_9_1_0(reason) VTK_DEPRECATION(reason)
77 #else
78 #define VTK_DEPRECATED_IN_9_1_0(reason)
79 #endif
80 
81 // APIs deprecated in 9.0.0.
82 #if VTK_DEPRECATION_LEVEL >= VTK_VERSION_CHECK(9, 0, 0)
83 #define VTK_DEPRECATED_IN_9_0_0(reason) VTK_DEPRECATION(reason)
84 #else
85 #define VTK_DEPRECATED_IN_9_0_0(reason)
86 #endif
87 
88 // APIs deprecated in the older release always warn.
89 #define VTK_DEPRECATED_IN_8_2_0(reason) VTK_DEPRECATION(reason)
90 
91 #endif
vtkVersion.h