Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoDeprecationRules.h
Go to the documentation of this file.
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2023 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : David Beilloin (Jan 2013)
22**=======================================================================*/
23#ifndef _SO_DEPRECATION_RULES_H_
24#define _SO_DEPRECATION_RULES_H_
25
26#include <SoVersion.h>
27
28#ifndef __has_feature
29#define __has_feature(x) 0
30#endif
31
32#ifndef __has_extension
33#define __has_extension(x) __has_feature
34#endif
35
36
50#if defined(SoDEPRECATED_HIDDEN)
51#define SoDEPRECATED_ERROR_VERSION (SO_INVENTOR_VERSION)
52
53#elif defined(SO_VERSION_DEPRECATED_ERROR) && SO_VERSION_DEPRECATED_ERROR != 0
54#define SoDEPRECATED_ERROR_VERSION SO_VERSION_DEPRECATED_ERROR*1000
55
56#else
57#define SoDEPRECATED_ERROR_VERSION 0
58#endif
59
60#ifndef HIDDEN_FROM_DOC
61
66#define 1 \
67
75#if defined SoDEPRECATED_NO_WARN
76 #define SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage)
77#else
78#if defined(_MSC_VER) && (_MSC_VER >= 1300)
79#define SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage) __declspec(deprecated("Deprecated since OIV" #DeprecationVersion ". " DeprecationMessage " Will be removed on next major version."))
80#elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ >= 3) && (__GNUC_MINOR__ >= 4)))
81#if __has_extension(attribute_deprecated_with_message)
82#define SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage) __attribute__ ((deprecated("Deprecated since OIV" #DeprecationVersion ". " DeprecationMessage)))
83#else
84#define SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage) __attribute__ ((deprecated()))
85#endif
86#else
87#error "You need to define SoDEPRECATED_PROTO macro"
88#endif
89#endif
90class SoDEPRECATED SoMyDeprecatedClass
98 * {
99 * }
100 * \endcode
101 */
102#define SoDEPRECATED_CLASS(DeprecationVersion,DeprecationMessage) \
103 SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage)
104
105#if defined SoDEPRECATED_NO_WARN
106 #define SoDEPRECATED_HEADER(DeprecationVersion, DeprecationMessage)
107#else
108#if _MSC_VER
109 #define SoDEPRECATED_HEADER(DeprecationVersion, DeprecationMessage) \
110 __pragma(message("warning C4996: Deprecated since OIV" #DeprecationVersion ". " DeprecationMessage " Will be removed in a future major version."))
111#elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ >= 3) && (__GNUC_MINOR__ >= 4)))
112 #define DO_PRAGMA(x) _Pragma(#x)
113 #define SoDEPRECATED_HEADER(DeprecationVersion, DeprecationMessage) \
114 DO_PRAGMA(message ("warning: Deprecated since OIV" #DeprecationVersion ". " DeprecationMessage " Will be removed in a future major version."))
115#else
116 #error "You need to define SoDEPRECATED_HEADER macro"
117#endif
118#endif
119class SoDEPRECATED SoMyDeprecatedClass
127 * {
128 * }
129 * \endcode
130 */
131#define SoDEPRECATED_CLASS_NOWARN(DeprecationVersion,DeprecationMessage)
132SoDEPRECATED
139 * void simpleMethod93();
140 * \endcode
141 */
142#define SoDEPRECATED_METHOD(DeprecationVersion,DeprecationMessage) \
143 SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage)
144SoDEPRECATED
151 * void simpleMethod93();
152 * \endcode
153 */
154#define SoDEPRECATED_METHOD_NOWARN(DeprecationVersion,DeprecationMessage)
155SoDEPRECATED
162 * int m_myMember;
163 * \endcode
164 */
165#define SoDEPRECATED_MEMBER(DeprecationVersion,DeprecationMessage) \
166 SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage)
167SoDEPRECATED
174 * int m_myMember;
175 * \endcode
176 */
177#define SoDEPRECATED_MEMBER_NOWARN(DeprecationVersion,DeprecationMessage) \
178SoDEPRECATED int myTypeDef;
185 * \endcode
186 */
187#define SoDEPRECATED_TYPEDEF(DeprecationVersion,DeprecationMessage) \
188 SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage)
189SoDEPRECATED enum
196 * MyEnum1 {
197 * VALUE0_1,
198 * VALUE1_1,
199 * VALUE2_1
200 * };
201 * \endcode
202 *
203 * @NOTES
204 * No cpp compiler warning will be issued on usage of this enum.
205 */
206#define SoDEPRECATED_ENUM(DeprecationVersion,DeprecationMessage)
207SoDEPRECATED
216 * VALUE1_0,
217 * VALUE2_0
218 * };
219 * \endcode
220 *
221 * @NOTES
222 * No compiler warning will be issued.
223 *
224 */
225#define SoDEPRECATED_ENUM_VALUE(DeprecationVersion,DeprecationMessage)
226SoDEPRECATED
235 * SoSFBool enableThisMode;
236 * \endcode
237 */
238#define SoDEPRECATED_FIELD(DeprecationVersion,DeprecationMessage)\
239 SoDEPRECATED_MEMBER_NOWARN(DeprecationVersion,DeprecationMessage)
240
241#endif // HIDDEN_FROM_DOC
242
243#endif // _SO_DEPRECATION_RULES_H_
Field containing a single Boolean value.
Definition SoSFBool.h:79