X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c0720183f5c78d0f0f99a5935b8ec4e953b4fef..c15d9c859c64f28c56d1e61b7d031a74e6018583:/src/common/utilscmn.cpp diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 190855940f..0580ea7678 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -29,14 +29,13 @@ #endif #ifndef WX_PRECOMP - #include "wx/defs.h" + #include "wx/app.h" #include "wx/string.h" #include "wx/utils.h" #include "wx/intl.h" #include "wx/log.h" #if wxUSE_GUI - #include "wx/app.h" #include "wx/window.h" #include "wx/frame.h" #include "wx/menu.h" @@ -50,10 +49,10 @@ #endif // wxUSE_GUI #endif // WX_PRECOMP -#ifndef __WIN16__ +#include "wx/apptrait.h" + #include "wx/process.h" #include "wx/txtstrm.h" -#endif #include #include @@ -89,7 +88,7 @@ #include "wx/msw/private.h" #endif -#ifdef __WXBASE__ +#if wxUSE_BASE // ---------------------------------------------------------------------------- // common data @@ -292,6 +291,16 @@ wxString wxGetDataDir() return dir; } +int wxGetOsVersion(int *verMaj, int *verMin) +{ + // we want this function to work even if there is no wxApp + wxConsoleAppTraits traitsConsole; + wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL; + if ( ! traits ) + traits = &traitsConsole; + + return traits->GetOSVersion(verMaj, verMin); +} // ---------------------------------------------------------------------------- // network and user id functions @@ -472,11 +481,6 @@ static long wxDoExecuteWithCapture(const wxString& command, wxArrayString& output, wxArrayString* error) { -#ifdef __WIN16__ - wxFAIL_MSG("Sorry, this version of wxExecute not implemented on WIN16."); - - return 0; -#else // !Win16 // create a wxProcess which will capture the output wxProcess *process = new wxProcess; process->Redirect(); @@ -501,7 +505,6 @@ static long wxDoExecuteWithCapture(const wxString& command, delete process; return rc; -#endif // IO redirection supported } long wxExecute(const wxString& command, wxArrayString& output) @@ -530,7 +533,7 @@ bool wxYieldIfNeeded() return wxTheApp && wxTheApp->Yield(TRUE); } -#endif // __WXBASE__ +#endif // wxUSE_BASE // ============================================================================ // GUI-only functions from now on