]> git.saurik.com Git - wxWidgets.git/commitdiff
Switch to overriding OnAssertFailure instead of OnAssert
authorRobin Dunn <robin@alldunn.com>
Sat, 10 Jun 2006 03:31:01 +0000 (03:31 +0000)
committerRobin Dunn <robin@alldunn.com>
Sat, 10 Jun 2006 03:31:01 +0000 (03:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/include/wx/wxPython/wxPython_int.h
wxPython/src/helpers.cpp

index 8aaf5f46baf2be1c4bbcfa22359921cd0bfc62f7..26aa87d7f83a706ff344509dca5e9fcb8df927b9 100644 (file)
@@ -602,10 +602,11 @@ public:
     virtual bool OnInitGui();
     virtual int OnExit();
 #ifdef __WXDEBUG__
-    virtual void OnAssert(const wxChar *file,
-                          int line,
-                          const wxChar *cond,
-                          const wxChar *msg);
+    virtual void OnAssertFailure(const wxChar *file,
+                                 int line,
+                                 const wxChar *func,
+                                 const wxChar *cond,
+                                 const wxChar *msg);
 #endif
     virtual void ExitMainLoop();
     // virtual int FilterEvent(wxEvent& event); // This one too????
index 572ada736f85386376d76235b5dba91392773189..470815f2675ac4aedf2da3d0b83f61155742648f 100644 (file)
@@ -191,21 +191,23 @@ void wxPyApp::ExitMainLoop() {
 
 
 #ifdef __WXDEBUG__
-void wxPyApp::OnAssert(const wxChar *file,
-                     int line,
-                     const wxChar *cond,
-                     const wxChar *msg) {
-
+void wxPyApp::OnAssertFailure(const wxChar *file,
+                              int line,
+                              const wxChar *func,
+                              const wxChar *cond,
+                              const wxChar *msg)
+{
     // if we're not fully initialized then just log the error
     if (! m_startupComplete) {
         wxString buf;
         buf.Alloc(4096);
         buf.Printf(wxT("%s(%d): assert \"%s\" failed"),
                    file, line, cond);
-        if (msg != NULL) {
-            buf += wxT(": ");
-            buf += msg;
-        }
+        if ( func && *func )
+            buf << wxT(" in ") << func << wxT("()");
+        if (msg != NULL) 
+            buf << wxT(": ") << msg;
+        
         wxLogDebug(buf);
         return;
     }
@@ -239,11 +241,12 @@ void wxPyApp::OnAssert(const wxChar *file,
         if (m_assertMode & wxPYAPP_ASSERT_EXCEPTION) {
             wxString buf;
             buf.Alloc(4096);
-            buf.Printf(wxT("C++ assertion \"%s\" failed in %s(%d)"), cond, file, line);
-            if (msg != NULL) {
-                buf += wxT(": ");
-                buf += msg;
-            }
+            buf.Printf(wxT("C++ assertion \"%s\" failed at %s(%d)"), cond, file, line);
+            if ( func && *func )
+                buf << wxT(" in ") << func << wxT("()");
+            if (msg != NULL) 
+                buf << wxT(": ") << msg;
+            
 
             // set the exception
             wxPyBlock_t blocked = wxPyBeginBlockThreads();
@@ -264,10 +267,10 @@ void wxPyApp::OnAssert(const wxChar *file,
             buf.Alloc(4096);
             buf.Printf(wxT("%s(%d): assert \"%s\" failed"),
                        file, line, cond);
-            if (msg != NULL) {
-                buf += wxT(": ");
-                buf += msg;
-            }
+            if ( func && *func )
+                buf << wxT(" in ") << func << wxT("()");
+            if (msg != NULL) 
+                buf << wxT(": ") << msg;
             wxLogDebug(buf);
         }