Use standard [[deprecated]] attribute if available

Add yet another wxDEPRECATED_XXX macro, this one simply expanding to
C++14 [[deprecated]] attribute if it's available and nothing otherwise.

It's a bit ridiculous to have so many different macros for deprecating
things, but the new one is useful because the standard attribute can be
used to deprecated enum elements, which is impossible with MSVC-specific
__declspec(deprecated).
This commit is contained in:
Vadim Zeitlin
2021-07-11 13:36:46 +01:00
parent 4f7f7a9ce1
commit 7a8f2dffbd
3 changed files with 46 additions and 6 deletions

View File

@@ -1600,6 +1600,17 @@ template <typename T> void wxDELETE(T*& ptr);
*/
template <typename T> void wxDELETEA(T*& array);
/**
Expands to the standard C++14 [[deprecated]] attribute if supported.
If not supported by the compiler, expands to nothing. If support for such
compilers is important, use wxDEPRECATED_MSG() which is almost universally
available.
@since 3.1.6
*/
#define wxDEPRECATED_ATTR(msg) [[deprecated(msg)]]
/**
Generate deprecation warning with the given message when a function is
used.