23#ifndef _SO_DEPRECATION_RULES_H_
24#define _SO_DEPRECATION_RULES_H_
29#define __has_feature(x) 0
32#ifndef __has_extension
33#define __has_extension(x) __has_feature
50#if defined(SoDEPRECATED_HIDDEN)
51#define SoDEPRECATED_ERROR_VERSION (SO_INVENTOR_VERSION)
53#elif defined(SO_VERSION_DEPRECATED_ERROR) && SO_VERSION_DEPRECATED_ERROR != 0
54#define SoDEPRECATED_ERROR_VERSION SO_VERSION_DEPRECATED_ERROR*1000
57#define SoDEPRECATED_ERROR_VERSION 0
60#ifndef HIDDEN_FROM_DOC
75#if defined SoDEPRECATED_NO_WARN
76 #define SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage)
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)))
84#define SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage) __attribute__ ((deprecated()))
87#error "You need to define SoDEPRECATED_PROTO macro"
90class SoDEPRECATED SoMyDeprecatedClass
102#define SoDEPRECATED_CLASS(DeprecationVersion,DeprecationMessage) \
103 SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage)
105#if defined SoDEPRECATED_NO_WARN
106 #define SoDEPRECATED_HEADER(DeprecationVersion, DeprecationMessage)
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."))
116 #error "You need to define SoDEPRECATED_HEADER macro"
119class SoDEPRECATED SoMyDeprecatedClass
131#define SoDEPRECATED_CLASS_NOWARN(DeprecationVersion,DeprecationMessage)
139 *
void simpleMethod93();
142#define SoDEPRECATED_METHOD(DeprecationVersion,DeprecationMessage) \
143 SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage)
151 *
void simpleMethod93();
154#define SoDEPRECATED_METHOD_NOWARN(DeprecationVersion,DeprecationMessage)
165#define SoDEPRECATED_MEMBER(DeprecationVersion,DeprecationMessage) \
166 SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage)
177#define SoDEPRECATED_MEMBER_NOWARN(DeprecationVersion,DeprecationMessage) \
178SoDEPRECATED int myTypeDef;
187#define SoDEPRECATED_TYPEDEF(DeprecationVersion,DeprecationMessage) \
188 SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage)
204 * No cpp compiler warning will be issued on usage of
this enum.
206#define SoDEPRECATED_ENUM(DeprecationVersion,DeprecationMessage)
222 * No compiler warning will be issued.
225#define SoDEPRECATED_ENUM_VALUE(DeprecationVersion,DeprecationMessage)
238#define SoDEPRECATED_FIELD(DeprecationVersion,DeprecationMessage)\
239 SoDEPRECATED_MEMBER_NOWARN(DeprecationVersion,DeprecationMessage)
Field containing a single Boolean value.