]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/object.h
optimizing gauge cpu usage
[wxWidgets.git] / include / wx / object.h
index 20aa447d2d12797a86ad3713228d6aae0c8095a6..d3081e897def0f187958db374cbd6a1bfbc1f301 100644 (file)
@@ -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__