Fix uses of wxDEPRECATED in WXWIN_COMPATIBILITY_2_8-only code

wxDEPRECATED must be used for the entire declaration to really work,
but this wasn't the case for a few functions (and one typedef) guarded
by WXWIN_COMPATIBILITY_2_8, resulting in gcc -Wattributes warning about
the attribute being ignored and the declaration not being really marked
as deprecated.

Fix this by applying the deprecation macro to the entire declaration,
which works well for gcc and should hopefully work for MSVC too.
This commit is contained in:
Vadim Zeitlin
2021-11-28 21:42:06 +01:00
parent 9febbe2b30
commit d14e035580
6 changed files with 7 additions and 7 deletions

View File

@@ -139,7 +139,7 @@ public:
#if WXWIN_COMPATIBILITY_2_8 #if WXWIN_COMPATIBILITY_2_8
// use PushBack(), it's the same thing // use PushBack(), it's the same thing
static wxDEPRECATED( void Insert(wxArtProvider *provider) ); wxDEPRECATED( static void Insert(wxArtProvider *provider) );
#endif #endif
// Remove latest added provider and delete it. // Remove latest added provider and delete it.

View File

@@ -83,7 +83,7 @@ protected:
// directly deprecating the classes...) // directly deprecating the classes...)
// //
// note that this g++ bug (16370) is supposed to be fixed in g++ 4.3.0 // note that this g++ bug (16370) is supposed to be fixed in g++ 4.3.0
typedef wxEffectsImpl wxDEPRECATED(wxEffects); wxDEPRECATED(typedef wxEffectsImpl wxEffects);
#endif // WXWIN_COMPATIBILITY_2_8 #endif // WXWIN_COMPATIBILITY_2_8

View File

@@ -645,14 +645,14 @@ public:
} }
) )
static wxDEPRECATED( wxDEPRECATED(static
wxImageHandler *FindHandler(const wxString& ext, long type) wxImageHandler *FindHandler(const wxString& ext, long type)
{ {
return FindHandler(ext, (wxBitmapType)type); return FindHandler(ext, (wxBitmapType)type);
} }
) )
static wxDEPRECATED( wxDEPRECATED(static
wxImageHandler *FindHandler(long imageType) wxImageHandler *FindHandler(long imageType)
{ {
return FindHandler((wxBitmapType)imageType); return FindHandler((wxBitmapType)imageType);

View File

@@ -578,7 +578,7 @@ public:
// don't use integer masks any more, use string trace masks instead // don't use integer masks any more, use string trace masks instead
#if WXWIN_COMPATIBILITY_2_8 #if WXWIN_COMPATIBILITY_2_8
static wxDEPRECATED_INLINE( void SetTraceMask(wxTraceMask ulMask), wxDEPRECATED_INLINE( static void SetTraceMask(wxTraceMask ulMask),
ms_ulTraceMask = ulMask; ) ms_ulTraceMask = ulMask; )
// this one can't be marked deprecated as it's used in our own wxLogger // this one can't be marked deprecated as it's used in our own wxLogger

View File

@@ -146,7 +146,7 @@ public:
wxDEPRECATED( const wxString& GetText() const ); wxDEPRECATED( const wxString& GetText() const );
// Now use GetLabelText to strip the accelerators // Now use GetLabelText to strip the accelerators
static wxDEPRECATED( wxString GetLabelFromText(const wxString& text) ); wxDEPRECATED( static wxString GetLabelFromText(const wxString& text) );
// Now use SetItemLabel // Now use SetItemLabel
wxDEPRECATED( virtual void SetText(const wxString& str) ); wxDEPRECATED( virtual void SetText(const wxString& str) );

View File

@@ -81,7 +81,7 @@ public:
// unnaturally: it disabled the bell when it was true, not false as could // unnaturally: it disabled the bell when it was true, not false as could
// be expected; use SuppressBellOnError() instead // be expected; use SuppressBellOnError() instead
#if WXWIN_COMPATIBILITY_2_8 #if WXWIN_COMPATIBILITY_2_8
static wxDEPRECATED_INLINE( wxDEPRECATED_INLINE(static
void SetBellOnError(bool doIt = true), void SetBellOnError(bool doIt = true),
ms_isSilent = doIt; ms_isSilent = doIt;
) )