From 114895c68ba9d2549d19e9af2ebf84ad40d36e55 Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Sun, 22 Mar 2009 08:39:31 +0000
Subject: [PATCH] always define ShowAssertDialog() but do nothing in it if
 debug level is 0

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 src/common/appcmn.cpp | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp
index 5ba2544468..a921b1825a 100644
--- a/src/common/appcmn.cpp
+++ b/src/common/appcmn.cpp
@@ -42,16 +42,6 @@
 #include "wx/vidmode.h"
 #include "wx/evtloop.h"
 
-#ifdef __WXDEBUG__
-    #if wxUSE_STACKWALKER
-        #include "wx/stackwalk.h"
-    #endif // wxUSE_STACKWALKER
-#endif // __WXDEBUG__
-
-#if defined(__WXMSW__)
-    #include  "wx/msw/private.h"  // includes windows.h for LOGFONT
-#endif
-
 #if wxUSE_FONTMAP
     #include "wx/fontmap.h"
 #endif // wxUSE_FONTMAP
@@ -487,10 +477,9 @@ wxRendererNative *wxGUIAppTraitsBase::CreateRenderer()
     return NULL;
 }
 
-#if 1 // def __WXDEBUG__
-
 bool wxGUIAppTraitsBase::ShowAssertDialog(const wxString& msg)
 {
+#if wxDEBUG_LEVEL
     // under MSW we prefer to use the base class version using ::MessageBox()
     // even if wxMessageBox() is available because it has less chances to
     // double fault our app than our wxMessageBox()
@@ -534,13 +523,16 @@ bool wxGUIAppTraitsBase::ShowAssertDialog(const wxString& msg)
 
         //case wxNO: nothing to do
     }
+#endif // !wxUSE_MSGDLG/wxUSE_MSGDLG
+#else // !wxDEBUG_LEVEL
+    // this function always exists (for ABI compatibility) but is never called
+    // if debug level is 0 and so can simply do nothing then
+    wxUnusedVar(msg);
+#endif // wxDEBUG_LEVEL/!wxDEBUG_LEVEL
 
     return false;
-#endif // !wxUSE_MSGDLG/wxUSE_MSGDLG
 }
 
-#endif // __WXDEBUG__
-
 bool wxGUIAppTraitsBase::HasStderr()
 {
     // we consider that under Unix stderr always goes somewhere, even if the
-- 
2.47.2