]> git.saurik.com Git - wxWidgets.git/commitdiff
added wOnAssert(..., wxCStrData) overload to fix compilation of code using wxASSERT...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 22 May 2007 01:36:24 +0000 (01:36 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 22 May 2007 01:36:24 +0000 (01:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46152 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/debug.h
src/common/appbase.cpp

index 69d0b1eb81bd550f93c22187e58a5029696815c2..b5854654c391eb7410abecec27d216e19b9d3926 100644 (file)
@@ -92,7 +92,7 @@
   /*
     This function is called whenever one of debugging macros fails (i.e.
     condition is false in an assertion). To customize its behaviour, override
-    wxApp::OnAssert().
+    wxApp::OnAssertFailure().
 
     Parameters:
        szFile and nLine - file name and line number of the ASSERT
        szMsg            - optional message explaining the reason
   */
 
-  /* this version is for compatibility with wx 2.8: */
+  /* this version is for compatibility with wx 2.8 Unicode build only: */
   extern void WXDLLIMPEXP_BASE wxOnAssert(const wxChar *szFile,
                                           int nLine,
                                           const char *szFunc,
 #endif // wxUSE_UNICODE
 
   class WXDLLIMPEXP_BASE wxString;
-  /* these two work when szMsg passed to debug macro is a string: */
+  class WXDLLIMPEXP_BASE wxCStrData;
+
+  /* these two work when szMsg passed to debug macro is a string,
+     we also have to provide wxCStrData overload to resolve ambiguity
+     which would otherwise arise from wxASSERT( s.c_str() ): */
   extern void WXDLLIMPEXP_BASE wxOnAssert(const wxString& szFile,
                                           int nLine,
                                           const wxString& szFunc,
                                           const wxString& szFunc,
                                           const wxString& szCond);
 
+  extern void WXDLLIMPEXP_BASE wxOnAssert(const char *szFile,
+                                          int nLine,
+                                          const char *szFunc,
+                                          const char *szCond,
+                                          const wxCStrData& msg);
+
   extern void WXDLLIMPEXP_BASE wxOnAssert(const char *szFile,
                                           int nLine,
                                           const char *szFunc,
index 9a4389dd05b964ac5ec33ee348d3666f61856b06..aeeb572a1bc87f41ee2a50007f279103ed691a02 100644 (file)
@@ -853,6 +853,15 @@ void wxOnAssert(const char *szFile,
     wxDoOnAssert(szFile, nLine, szFunc, szCond, szMsg);
 }
 
+void wxOnAssert(const char *szFile,
+                int nLine,
+                const char *szFunc,
+                const char *szCond,
+                const wxCStrData& msg)
+{
+    wxDoOnAssert(szFile, nLine, szFunc, szCond, msg);
+}
+
 #if wxUSE_UNICODE
 void wxOnAssert(const char *szFile,
                 int nLine,