X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7e548f6b13a27eee6f2740d922cab636f0b305e0..456fd7b661b2aa150443fe47a8c9c728c0509f73:/include/wx/object.h diff --git a/include/wx/object.h b/include/wx/object.h index 20aa447d2d..d3081e897d 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -183,7 +183,7 @@ inline void wxClassInfo::CleanUpClasses() {} // Single inheritance with one base class #define IMPLEMENT_DYNAMIC_CLASS(name, basename) \ - wxObject* name::wxCreateObject() \ + wxObject* name::wxCreateObject() \ { return new name; } \ wxClassInfo name::ms_classInfo(wxT(#name), \ &basename::ms_classInfo, NULL, \ @@ -193,12 +193,12 @@ inline void wxClassInfo::CleanUpClasses() {} // Multiple inheritance with two base classes #define IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) \ - wxObject* name::wxCreateObject() \ + wxObject* name::wxCreateObject() \ { return new name; } \ wxClassInfo name::ms_classInfo(wxT(#name), \ &basename1::ms_classInfo, \ &basename2::ms_classInfo, \ - wxT(#basename2), (int) sizeof(name), \ + (int) sizeof(name), \ (wxObjectConstructorFn) name::wxCreateObject); // ----------------------------------- @@ -547,7 +547,11 @@ public: // get the runtime identity of this object wxClassInfo *GetClassInfo() const { +#ifdef _MSC_VER + return (wxClassInfo*) m_classInfo; +#else return wx_const_cast(wxClassInfo *, m_classInfo); +#endif } wxObject* GetSuperClassInstance() const @@ -586,6 +590,9 @@ private : #if defined(__WXDEBUG__) && wxUSE_GLOBAL_MEMORY_OPERATORS && wxUSE_DEBUG_NEW_ALWAYS #define new new(__TFILE__,__LINE__) +#elif (defined(__WXDEBUG__) && defined(__VISUALC__) && !wxUSE_GLOBAL_MEMORY_OPERATORS && wxUSE_DEBUG_NEW_ALWAYS) + // Including this file redefines new and allows leak reports to contain line numbers + #include "wx/msw/msvcrt.h" #endif #endif // _WX_OBJECTH__