projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added wxEncodingToCodepage() and implemented it properly (using in32 API instead...
[wxWidgets.git]
/
include
/
wx
/
object.h
diff --git
a/include/wx/object.h
b/include/wx/object.h
index 316d8d569c707f87270503b858f3828d97c505ac..69e379684232b87b000d1425aa391f1527305153 100644
(file)
--- a/
include/wx/object.h
+++ b/
include/wx/object.h
@@
-171,9
+171,7
@@
wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
// to be replaced by dynamic_cast<> in the future
#define wxDynamicCast(obj, className) \
// to be replaced by dynamic_cast<> in the future
#define wxDynamicCast(obj, className) \
- ((obj) && ((obj)->IsKindOf(&className::sm_class##className)) \
- ? (className *)(obj) \
- : (className *)0)
+ (className *) wxCheckDynamicCast((wxObject*)(obj), &className::sm_class##className)
// The 'this' pointer is always true, so use this version to cast the this
// pointer and avoid compiler warnings.
// The 'this' pointer is always true, so use this version to cast the this
// pointer and avoid compiler warnings.
@@
-295,6
+293,11
@@
private:
int m_count;
};
int m_count;
};
+inline wxObject *wxCheckDynamicCast(wxObject *obj, wxClassInfo *classInfo)
+{
+ return obj && obj->GetClassInfo()->IsKindOf(classInfo) ? obj : 0;
+}
+
#ifdef __WXDEBUG__
#ifndef WXDEBUG_NEW
#define WXDEBUG_NEW new(__TFILE__,__LINE__)
#ifdef __WXDEBUG__
#ifndef WXDEBUG_NEW
#define WXDEBUG_NEW new(__TFILE__,__LINE__)