fixing deprecated constructors for osx

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55696 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2008-09-18 09:12:32 +00:00
parent 326b62161d
commit 70bf329592
3 changed files with 17 additions and 9 deletions

View File

@@ -582,6 +582,17 @@ typedef short int WXTYPE;
#define wxDEPRECATED(x) x #define wxDEPRECATED(x) x
#endif #endif
/*
explicitly specifying inline allows gcc < 3.4 to
handle the deprecation attribute even in the constructor.
doesn't seem to work on Apple's gcc 4.0.1 unless using -O0
*/
#if defined( __DARWIN__ ) && !defined(__WXDEBUG__)
#define wxDEPRECATED_CONSTRUCTOR(x) x
#else
#define wxDEPRECATED_CONSTRUCTOR(x) wxDEPRECATED( inline x)
#endif
/* /*
Macro which marks the function as being deprecated but also defines it Macro which marks the function as being deprecated but also defines it
inline. inline.

View File

@@ -79,9 +79,8 @@ public:
AddIcon(file, (wxBitmapType)type); AddIcon(file, (wxBitmapType)type);
} }
) )
// explicitly specifying inline allows gcc < 3.4 to
// handle the deprecation attribute even in the constructor. wxDEPRECATED_CONSTRUCTOR( wxIconBundle (const wxString& file, long type)
wxDEPRECATED( inline wxIconBundle (const wxString& file, long type)
{ {
AddIcon(file, (wxBitmapType)type); AddIcon(file, (wxBitmapType)type);
} }

View File

@@ -440,18 +440,16 @@ public:
static RGBValue HSVtoRGB(const HSVValue& hsv); static RGBValue HSVtoRGB(const HSVValue& hsv);
#if WXWIN_COMPATIBILITY_2_8 #if WXWIN_COMPATIBILITY_2_8
// explicitly specifying inline allows gcc < 3.4 to wxDEPRECATED_CONSTRUCTOR(
// handle the deprecation attribute even in the constructor. wxImage(const wxString& name, long type, int index = -1)
wxDEPRECATED(
inline wxImage(const wxString& name, long type, int index = -1)
{ {
LoadFile(name, (wxBitmapType)type, index); LoadFile(name, (wxBitmapType)type, index);
} }
) )
#if wxUSE_STREAMS #if wxUSE_STREAMS
wxDEPRECATED( wxDEPRECATED_CONSTRUCTOR(
inline wxImage(wxInputStream& stream, long type, int index = -1) wxImage(wxInputStream& stream, long type, int index = -1)
{ {
LoadFile(stream, (wxBitmapType)type, index); LoadFile(stream, (wxBitmapType)type, index);
} }