X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/da1d313d806da94e50b592e88b3ac233a3043a6a..df1f4832e5e08438255594172b4c2b31b34f6453:/src/common/appbase.cpp diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index d15e4a5d41..1a13c3f339 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -43,7 +43,7 @@ #include // for SIGTRAP used by wxTrap() #endif //Win/Unix -#if defined(__WXMSW__) +#if defined(__WXMSW__) && !defined(__PALMOS__) #include "wx/msw/wrapwin.h" // includes windows.h for MessageBox() #endif @@ -128,21 +128,25 @@ wxAppConsole::~wxAppConsole() bool wxAppConsole::Initialize(int& argc, wxChar **argv) { +#if wxUSE_LOG // If some code logged something before wxApp instance was created, // wxLogStderr was set as the target. Undo it here by destroying the // current target. It will be re-created next time logging is needed, but // this time wxAppTraits will be used: delete wxLog::SetActiveTarget(NULL); - +#endif // wxUSE_LOG + // remember the command line arguments this->argc = argc; this->argv = argv; +#ifndef __PALMOS__ if ( m_appName.empty() && argv ) { // the application name is, by default, the name of its executable file wxFileName::SplitPath(argv[0], NULL, &m_appName, NULL); } +#endif return true; } @@ -163,7 +167,7 @@ bool wxAppConsole::OnInit() OnInitCmdLine(parser); bool cont; - switch ( parser.Parse(FALSE /* don't show usage */) ) + switch ( parser.Parse(false /* don't show usage */) ) { case -1: cont = OnCmdLineHelp(parser); @@ -179,10 +183,10 @@ bool wxAppConsole::OnInit() } if ( !cont ) - return FALSE; + return false; #endif // wxUSE_CMDLINE_PARSER - return TRUE; + return true; } int wxAppConsole::OnExit() @@ -368,25 +372,27 @@ bool wxAppConsole::OnCmdLineParsed(wxCmdLineParser& parser) #if wxUSE_LOG if ( parser.Found(OPTION_VERBOSE) ) { - wxLog::SetVerbose(TRUE); + wxLog::SetVerbose(true); } +#else + wxUnusedVar(parser); #endif // wxUSE_LOG - return TRUE; + return true; } bool wxAppConsole::OnCmdLineHelp(wxCmdLineParser& parser) { parser.Usage(); - return FALSE; + return false; } bool wxAppConsole::OnCmdLineError(wxCmdLineParser& parser) { parser.Usage(); - return FALSE; + return false; } #endif // wxUSE_CMDLINE_PARSER @@ -417,11 +423,11 @@ bool wxAppConsole::CheckBuildOptions(const char *optionsSignature, wxLogFatalError(msg.c_str()); // normally wxLogFatalError doesn't return - return FALSE; + return false; } #undef wxCMP - return TRUE; + return true; } #ifdef __WXDEBUG__ @@ -585,19 +591,19 @@ void wxOnAssert(const wxChar *szFile, const wxChar *szMsg) { // FIXME MT-unsafe - static bool s_bInAssert = FALSE; + static bool s_bInAssert = false; if ( s_bInAssert ) { // He-e-e-e-elp!! we're trapped in endless loop wxTrap(); - s_bInAssert = FALSE; + s_bInAssert = false; return; } - s_bInAssert = TRUE; + s_bInAssert = true; if ( !wxTheApp ) { @@ -611,7 +617,7 @@ void wxOnAssert(const wxChar *szFile, wxTheApp->OnAssert(szFile, nLine, szCond, szMsg); } - s_bInAssert = FALSE; + s_bInAssert = false; } #endif // __WXDEBUG__ @@ -681,7 +687,7 @@ void ShowAssertDialog(const wxChar *szFile, wxAppTraits *traits) { // this variable can be set to true to suppress "assert failure" messages - static bool s_bNoAsserts = FALSE; + static bool s_bNoAsserts = false; wxString msg; msg.reserve(2048);