From 8ddd25b88775b351e3737e3827a7a809105b6965 Mon Sep 17 00:00:00 2001 From: kgv Date: Sat, 30 Jan 2016 14:54:12 +0300 Subject: [PATCH] 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). --- src/Standard/Standard_Macro.hxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 //======================================================