X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4a92d4bc8d0e435c0d0df29a34300e19656c75d5..02bcd285fac7124a41292d905609220005f51087:/src/common/appbase.cpp diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index c2c7b05bf7..fe7471e1c7 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -57,18 +57,15 @@ #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 - // include everything when in doubt #ifdef __DARWIN__ - #include "MacTypes.h" + #include #else #include "wx/mac/private.h" // includes mac headers #endif #endif // __WXMAC__ #ifdef __WXDEBUG__ - #ifdef wxUSE_STACKWALKER + #if wxUSE_STACKWALKER #include "wx/stackwalk.h" #ifdef __WXMSW__ #include "wx/msw/debughlp.h" @@ -76,6 +73,13 @@ #endif // wxUSE_STACKWALKER #endif // __WXDEBUG__ +// wxABI_VERSION can be defined when compiling applications but it should be +// left undefined when compiling the library itself, it is then set to its +// default value in version.h +#if wxABI_VERSION != wxMAJOR_VERSION * 10000 + wxMINOR_VERSION * 100 + 99 +#error "wxABI_VERSION should not be defined when compiling the library" +#endif + // ---------------------------------------------------------------------------- // private functions prototypes // ---------------------------------------------------------------------------- @@ -140,19 +144,11 @@ wxAppConsole::~wxAppConsole() // initilization/cleanup // ---------------------------------------------------------------------------- -bool wxAppConsole::Initialize(int& argc, wxChar **argv) +bool wxAppConsole::Initialize(int& argcOrig, wxChar **argvOrig) { -#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; + argc = argcOrig; + argv = argvOrig; #ifndef __WXPALMOS__ if ( m_appName.empty() && argv ) @@ -710,14 +706,11 @@ bool DoShowAssertDialog(const wxString& msg) return false; } +#if wxUSE_STACKWALKER static wxString GetAssertStackTrace() { wxString stackTrace; - // check that we can get the stack trace before trying to do it - if ( !wxDbgHelpDLL::Init() ) - return stackTrace; - class StackDump : public wxStackWalker { public: @@ -728,7 +721,11 @@ static wxString GetAssertStackTrace() protected: virtual void OnStackFrame(const wxStackFrame& frame) { - m_stackTrace << wxString::Format(_T("[%02d] "), frame.GetLevel()); + m_stackTrace << wxString::Format + ( + _T("[%02d] "), + wx_truncate_cast(int, frame.GetLevel()) + ); wxString name = frame.GetName(); if ( !name.empty() ) @@ -737,11 +734,8 @@ static wxString GetAssertStackTrace() } else { - m_stackTrace << wxString::Format - ( - _T("0x%08lx"), - (unsigned long)frame.GetAddress() - ); + m_stackTrace << wxString::Format(_T("0x%08p"), + frame.GetAddress()); } if ( frame.HasSourceLocation() ) @@ -773,6 +767,7 @@ static wxString GetAssertStackTrace() return stackTrace; } +#endif // wxUSE_STACKWALKER // show the assert modal dialog static