From: kgv Date: Sat, 30 Jan 2016 11:54:12 +0000 (+0300) Subject: 0027113: Coding - add macros Standard_DEPRECATED for marking deprecated functionality X-Git-Tag: V7_0_0rc~35 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=8ddd25b88775b351e3737e3827a7a809105b6965;p=occt-copy.git 0027113: Coding - add macros Standard_DEPRECATED for marking deprecated functionality Macro Standard_DEPRECATED("message") can be used in declarations to mark a method deprecated and generate compiler warning when it is used. If OCCT_NO_DEPRECATED is defined, Standard_DEPRECATED is disabled (defined empty). --- diff --git a/src/Standard/Standard_Macro.hxx b/src/Standard/Standard_Macro.hxx index d7be33170c..1d2a2670c8 100644 --- a/src/Standard/Standard_Macro.hxx +++ b/src/Standard/Standard_Macro.hxx @@ -29,6 +29,22 @@ #define Standard_OVERRIDE #endif +// Macro Standard_DEPRECATED("message") can be used to declare a method deprecated. +// If OCCT_NO_DEPRECATED is defined, Standard_DEPRECATED is defined empty. +#ifdef OCCT_NO_DEPRECATED + #define Standard_DEPRECATED(theMsg) +#else +#if defined(_MSC_VER) + #define Standard_DEPRECATED(theMsg) __declspec(deprecated(theMsg)) +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || defined(__clang__)) + #define Standard_DEPRECATED(theMsg) __attribute__((deprecated(theMsg))) +#elif defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) + #define Standard_DEPRECATED(theMsg) __attribute__((deprecated)) +#else + #define Standard_DEPRECATED(theMsg) +#endif +#endif + //====================================================== // Windows-specific definitions //======================================================