]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appbase.cpp
Fix CYGWIN socket compilo
[wxWidgets.git] / src / common / appbase.cpp
index 45ce4a4c72166513e65e41caf48725f8a50dc8c2..ee78eb257c32e94ca252aff8bdde098feb24df2d 100644 (file)
     #include "wx/fontmap.h"
 #endif // wxUSE_FONTMAP
 
+#if defined(__DARWIN__) && defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS
+    // For MacTypes.h for Debugger function
+    #include <CoreFoundation/CFBase.h>
+#endif
+
 #if defined(__WXMAC__)
     // VZ: MacTypes.h is enough under Mac OS X (where I could test it) but
     //     I don't know which headers are needed under earlier systems so
@@ -582,6 +587,8 @@ void wxTrap()
     #else
         SysBreak();
     #endif
+#elif defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS
+    Debugger();
 #elif defined(__UNIX__)
     raise(SIGTRAP);
 #else
@@ -765,7 +772,19 @@ void ShowAssertDialog(const wxChar *szFile,
 
     StackDump dump;
     dump.Walk(5); // don't show OnAssert() call itself
-    const wxString& stackTrace = dump.GetStackTrace();
+    wxString stackTrace = dump.GetStackTrace();
+
+    // don't show more than maxLines or we could get a dialog too tall to be
+    // shown on screen: 20 should be ok everywhere as even with 15 pixel high
+    // characters it is still only 300 pixels...
+    const int maxLines = 20;
+    int count = stackTrace.Freq(wxT('\n'));
+    if (count > maxLines)
+    {
+        int i;
+        for (i = 0; i < count - maxLines; i++)
+            stackTrace = stackTrace.BeforeLast(wxT('\n'));
+    }
     if ( !stackTrace.empty() )
     {
         msg << _T("\n\nCall stack:\n")