X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8cfc5426cf50da368022813a04e29cf8ec5478a4..54921697ae6cb35c5865620dce494227b0df5e02:/include/wx/object.h diff --git a/include/wx/object.h b/include/wx/object.h index f6b11f8594..4603f3b123 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__