X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8cfc5426cf50da368022813a04e29cf8ec5478a4..505af178e72ed7a4d133c301d024976e188de354:/include/wx/object.h diff --git a/include/wx/object.h b/include/wx/object.h index f6b11f8594..f09a795b6b 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -175,6 +175,13 @@ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \ ? (className *)(obj) \ : (className *)0) +// The 'this' pointer is always true, so use this version to cast the this +// pointer and avoid compiler warnings. +#define wxDynamicThisCast(obj, className) \ + (((obj)->IsKindOf(&className::sm_class##className)) \ + ? (className *)(obj) \ + : (className *)0) + #define wxConstCast(obj, className) ((className *)(obj)) #ifdef __WXDEBUG__ @@ -191,6 +198,7 @@ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \ #endif // Debug/!Debug // Unfortunately Borland seems to need this include. +#if wxUSE_STD_IOSTREAM && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT) #ifdef __BORLANDC__ #if wxUSE_IOSTREAMH #include @@ -198,6 +206,7 @@ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \ #include #endif #endif +#endif class WXDLLEXPORT wxObjectRefData; @@ -247,7 +256,7 @@ class WXDLLEXPORT wxObject #endif // Debug & memory tracing #if wxUSE_STD_IOSTREAM && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT) - virtual void Dump(ostream& str); + virtual void Dump(wxSTD ostream& str); #endif #if wxUSE_SERIAL