]> git.saurik.com Git - wxWidgets.git/commitdiff
clicking on the messages about assert failures in VC++ brings up the source
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 2 Feb 1999 23:30:51 +0000 (23:30 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 2 Feb 1999 23:30:51 +0000 (23:30 +0000)
file at the line with the assert statement (nothing changed for other compilers)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1572 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/log.cpp

index 7063dc6548a0ccfe25cf1260024a1f35efe51b4c..8708f2debc52375bf1ea4b973f660cea57a454a3 100644 (file)
@@ -983,7 +983,16 @@ void wxOnAssert(const char *szFile, int nLine, const char *szMsg)
   s_bInAssert = TRUE;
 
   char szBuf[LOG_BUFFER_SIZE];
+
+  // make life easier for people using VC++ IDE: clicking on the message will
+  // take us immediately to the place of the failed assert
+#ifdef _MSC_VER
+  sprintf(szBuf, _("%s(%d): assert failed"), szFile, nLine);
+#else  // !VC++
+  // make the error message more clear for all the others
   sprintf(szBuf, _("Assert failed in file %s at line %d"), szFile, nLine);
+#endif // VC/!VC
+
   if ( szMsg != NULL ) {
     strcat(szBuf, ": ");
     strcat(szBuf, szMsg);