00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _SO_DEPRECATION_RULES_H_
00024 #define _SO_DEPRECATION_RULES_H_
00025
00026 #include <SoVersion.h>
00027
00028 #ifndef __has_feature
00029 #define __has_feature(x) 0
00030 #endif
00031
00032 #ifndef __has_extension
00033 #define __has_extension(x) __has_feature
00034 #endif
00035
00036
00050 #if defined(SoDEPRECATED_HIDDEN)
00051 #define SoDEPRECATED_ERROR_VERSION (SO_INVENTOR_VERSION)
00052
00053 #elif defined(SO_VERSION_DEPRECATED_ERROR) && SO_VERSION_DEPRECATED_ERROR != 0
00054 #define SoDEPRECATED_ERROR_VERSION SO_VERSION_DEPRECATED_ERROR*1000
00055
00056 #else
00057 #define SoDEPRECATED_ERROR_VERSION 0
00058 #endif
00059
00060 #ifndef HIDDEN_FROM_DOC
00061
00066 #define 1 \
00067
00075 #if defined SoDEPRECATED_NO_WARN
00076 #define SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage)
00077 #else
00078 #if defined(_MSC_VER) && (_MSC_VER >= 1300)
00079 #define SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage) __declspec(deprecated("Deprecated since OIV" #DeprecationVersion ". " DeprecationMessage " Will be removed on next major version."))
00080 #elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ >= 3) && (__GNUC_MINOR__ >= 4)))
00081 #if __has_extension(attribute_deprecated_with_message)
00082 #define SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage) __attribute__ ((deprecated("Deprecated since OIV" #DeprecationVersion ". " DeprecationMessage)))
00083 #else
00084 #define SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage) __attribute__ ((deprecated()))
00085 #endif
00086 #else
00087 #error "You need to define SoDEPRECATED_PROTO macro"
00088 #endif
00089 #endif
00090 class SoDEPRECATED SoMyDeprecatedClass
00098 * {
00099 * }
00100 * \endcode
00101 */
00102 #define SoDEPRECATED_CLASS(DeprecationVersion,DeprecationMessage) \
00103 SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage)
00104
00105 #if defined SoDEPRECATED_NO_WARN
00106 #define SoDEPRECATED_HEADER(DeprecationVersion, DeprecationMessage)
00107 #else
00108 #if _MSC_VER
00109 #define SoDEPRECATED_HEADER(DeprecationVersion, DeprecationMessage) \
00110 __pragma(message("warning C4996: Deprecated since OIV" #DeprecationVersion ". " DeprecationMessage " Will be removed on next major version."))
00111 #elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ >= 3) && (__GNUC_MINOR__ >= 4)))
00112 #define DO_PRAGMA(x) _Pragma(#x)
00113 #define SoDEPRECATED_HEADER(DeprecationVersion, DeprecationMessage) \
00114 DO_PRAGMA(message ("warning: Deprecated since OIV" #DeprecationVersion ". " DeprecationMessage " Will be removed on next major version"))
00115 #else
00116 #error "You need to define SoDEPRECATED_HEADER macro"
00117 #endif
00118 #endif
00119 class SoDEPRECATED SoMyDeprecatedClass
00127 * {
00128 * }
00129 * \endcode
00130 */
00131 #define SoDEPRECATED_CLASS_NOWARN(DeprecationVersion,DeprecationMessage)
00132 SoDEPRECATED
00139 * void simpleMethod93();
00140 * \endcode
00141 */
00142 #define SoDEPRECATED_METHOD(DeprecationVersion,DeprecationMessage) \
00143 SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage)
00144 SoDEPRECATED
00151 * void simpleMethod93();
00152 * \endcode
00153 */
00154 #define SoDEPRECATED_METHOD_NOWARN(DeprecationVersion,DeprecationMessage)
00155 SoDEPRECATED
00162 * int m_myMember;
00163 * \endcode
00164 */
00165 #define SoDEPRECATED_MEMBER(DeprecationVersion,DeprecationMessage) \
00166 SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage)
00167 SoDEPRECATED
00174 * int m_myMember;
00175 * \endcode
00176 */
00177 #define SoDEPRECATED_MEMBER_NOWARN(DeprecationVersion,DeprecationMessage) \
00178
00179 SoDEPRECATED int myTypeDef;
00185 * \endcode
00186 */
00187 #define SoDEPRECATED_TYPEDEF(DeprecationVersion,DeprecationMessage) \
00188 SoDEPRECATED_PROTO(DeprecationVersion,DeprecationMessage)
00189 SoDEPRECATED enum
00196 * MyEnum1 {
00197 * VALUE0_1,
00198 * VALUE1_1,
00199 * VALUE2_1
00200 * };
00201 * \endcode
00202 *
00203 * @NOTES
00204 * No cpp compiler warning will be issued on usage of this enum.
00205 */
00206 #define SoDEPRECATED_ENUM(DeprecationVersion,DeprecationMessage)
00207 SoDEPRECATED
00216 * VALUE1_0,
00217 * VALUE2_0
00218 * };
00219 * \endcode
00220 *
00221 * @NOTES
00222 * No compiler warning will be issued.
00223 *
00224 */
00225 #define SoDEPRECATED_ENUM_VALUE(DeprecationVersion,DeprecationMessage)
00226 SoDEPRECATED
00235 * SoSFBool enableThisMode;
00236 * \endcode
00237 */
00238 #define SoDEPRECATED_FIELD(DeprecationVersion,DeprecationMessage)\
00239 SoDEPRECATED_MEMBER_NOWARN(DeprecationVersion,DeprecationMessage)
00240
00241 #endif // HIDDEN_FROM_DOC
00242
00243 #endif // _SO_DEPRECATION_RULES_H_
00244