put __attribute__((deprecated)) before declaration and not after it as gcc seems to accept both and doing it like this allows to simplify wxDEPRECATED_INLINE() definition by using the same expansion for all compilers

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48878 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-09-21 13:57:07 +00:00
parent f07024ee6d
commit a9dce8897e

View File

@@ -516,16 +516,23 @@ typedef int wxWindowID;
/* Macro to issue warning when using deprecated functions with gcc3 or MSVC7: */ /* Macro to issue warning when using deprecated functions with gcc3 or MSVC7: */
#if wxCHECK_GCC_VERSION(3, 1) #if wxCHECK_GCC_VERSION(3, 1)
#define wxDEPRECATED(x) x __attribute__ ((deprecated)) #define wxDEPRECATED(x) __attribute__((deprecated)) x
#define wxDEPRECATED_INLINE(func, body) x { body } __attribute__ ((deprecated))
#elif defined(__VISUALC__) && (__VISUALC__ >= 1300) #elif defined(__VISUALC__) && (__VISUALC__ >= 1300)
#define wxDEPRECATED(x) __declspec(deprecated) x #define wxDEPRECATED(x) __declspec(deprecated) x
#define wxDEPRECATED_INLINE(func, body) __declspec(deprecated) x { body }
#else #else
#define wxDEPRECATED(x) x #define wxDEPRECATED(x) x
#define wxDEPRECATED_INLINE(func, body) func { body }
#endif #endif
/*
Macro which marks the function as being deprecated but also defines it
inline.
Currently it's defined in the same trivial way in all cases but it could
need a special definition with some other compilers in the future which
explains why do we have it.
*/
#define wxDEPRECATED_INLINE(func, body) wxDEPRECATED(func) { body }
/* /*
Special variant of the macro above which should be used for the functions Special variant of the macro above which should be used for the functions
which are deprecated but called by wx itself: this often happens with which are deprecated but called by wx itself: this often happens with