From 546db2a8f8e9975eba9e54d7f4b7f3546a4a515d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 1 Jun 1999 22:46:59 +0000 Subject: [PATCH] compilation fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2628 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/log.h | 35 +++++++++++++++++++++-------------- include/wx/msw/menu.h | 1 + include/wx/msw/setup0.h | 7 +++++++ src/msw/app.cpp | 6 ++++++ 4 files changed, 35 insertions(+), 14 deletions(-) diff --git a/include/wx/log.h b/include/wx/log.h index 3798dec97c..af0a164dd6 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -16,6 +16,25 @@ #pragma interface "log.h" #endif +// ---------------------------------------------------------------------------- +// forward declarations +// ---------------------------------------------------------------------------- + +class WXDLLEXPORT wxTextCtrl; +class WXDLLEXPORT wxLogFrame; +class WXDLLEXPORT wxFrame; + +// ---------------------------------------------------------------------------- +// types +// ---------------------------------------------------------------------------- + +typedef unsigned long wxTraceMask; +typedef unsigned long wxLogLevel; + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + #if wxUSE_LOG #include // for time_t @@ -68,17 +87,6 @@ enum #define wxTraceOleCalls 0x0100 // OLE interface calls #endif -typedef unsigned long wxTraceMask; -typedef unsigned long wxLogLevel; - -// ---------------------------------------------------------------------------- -// forward declarations -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTextCtrl; -class WXDLLEXPORT wxLogFrame; -class WXDLLEXPORT wxFrame; - #if wxUSE_IOSTREAMH // N.B. BC++ doesn't have istream.h, ostream.h # include @@ -376,10 +384,9 @@ extern void WXDLLEXPORT wxLog##level(arg1, const wxChar *szFormat, ...) // log functions do nothing at all #define DECLARE_LOG_FUNCTION(level) \ -inline void WXDLLEXPORT wxLog##level(const wxChar * WXUNUSED(szFormat), ...) {} +inline void WXDLLEXPORT wxLog##level(const wxChar *szFormat, ...) {} #define DECLARE_LOG_FUNCTION2(level, arg1) \ -inline void WXDLLEXPORT wxLog##level(WXUNUSED(arg1), \ - const wxChar *WXUNUSED(szFormat), ...) {} +inline void WXDLLEXPORT wxLog##level(arg1, const wxChar *szFormat, ...) {} #endif // wxUSE_LOG/!wxUSE_LOG diff --git a/include/wx/msw/menu.h b/include/wx/msw/menu.h index f01dafd080..82663872ef 100644 --- a/include/wx/msw/menu.h +++ b/include/wx/msw/menu.h @@ -18,6 +18,7 @@ #include "wx/defs.h" #include "wx/event.h" +#include "wx/dynarray.h" class WXDLLEXPORT wxMenuItem; class WXDLLEXPORT wxMenuBar; diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index 84e523cbb0..11cde04d7a 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -172,6 +172,13 @@ #define wxUSE_SOCKETS 0 // Set to 1 to use socket classes +// these settings can't be set to 0 for now +#define wxUSE_INTL 1 +#define wxUSE_LOG 1 +#define wxUSE_VALIDATORS 1 +#define wxUSE_ACCEL 1 +#define wxUSE_SASH 1 + /* * Finer detail * diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 33f10ba51a..dc629191c1 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -416,6 +416,7 @@ void wxApp::CleanUp() { //// COMMON CLEANUP +#if wxUSE_LOG // flush the logged messages if any and install a 'safer' log target: the // default one (wxLogGui) can't be used after the resources are freed just // below and the user suppliedo ne might be even more unsafe (using any @@ -424,6 +425,7 @@ void wxApp::CleanUp() // this will flush the old messages if any delete wxLog::SetActiveTarget(new wxLogStderr); +#endif // wxUSE_LOG // One last chance for pending objects to be cleaned up wxTheApp->DeletePendingObjects(); @@ -529,8 +531,10 @@ void wxApp::CleanUp() // wxDebugContext::SetStream(NULL, NULL); #endif +#if wxUSE_LOG // do it as the very last thing because everything else can log messages delete wxLog::SetActiveTarget(NULL); +#endif // wxUSE_LOG } #if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL)) @@ -944,10 +948,12 @@ void wxApp::OnIdle(wxIdleEvent& event) // 'Garbage' collection of windows deleted with Close(). DeletePendingObjects(); +#if wxUSE_LOG // flush the logged messages if any wxLog *pLog = wxLog::GetActiveTarget(); if ( pLog != NULL && pLog->HasPendingMessages() ) pLog->Flush(); +#endif // wxUSE_LOG // Send OnIdle events to all windows if ( SendIdleEvents() )