Applied patch [ 857446 ] wxStaticCast evaluates argument twice

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-12-11 10:54:38 +00:00
parent 557c9f5b0a
commit e32d483606

View File

@@ -348,12 +348,13 @@ name##PluginSentinel m_pluginsentinel;
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
inline void wxCheckCast(void *ptr) inline void* wxCheckCast(void *ptr)
{ {
wxASSERT_MSG( ptr, _T("wxStaticCast() used incorrectly") ); wxASSERT_MSG( ptr, _T("wxStaticCast() used incorrectly") );
return ptr;
} }
#define wxStaticCast(obj, className) \ #define wxStaticCast(obj, className) \
(wxCheckCast(wxDynamicCast(obj, className)), ((className *)(obj))) ((className *)wxCheckCast(wxDynamicCast(obj, className)))
#else // !__WXDEBUG__ #else // !__WXDEBUG__
#define wxStaticCast(obj, className) ((className *)(obj)) #define wxStaticCast(obj, className) ((className *)(obj))