X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/46446cc2aa025f445815545b31552a509b5e3f7e..ffafd8a55bb0b8fb4236e4522792a6b143813609:/src/unix/utilsunx.cpp diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 2f15a8cb26..8709321cf1 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -15,6 +15,9 @@ // headers // ---------------------------------------------------------------------------- +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #include "wx/defs.h" #include "wx/string.h" @@ -31,7 +34,15 @@ #include "wx/unix/execute.h" -#ifdef __WXBASE__ +#if wxUSE_STREAMS + +// define this to let wxexec.cpp know that we know what we're doing +#define _WX_USED_BY_WXEXECUTE_ +#include "../common/execcmn.cpp" + +#endif // wxUSE_STREAMS + +#if wxUSE_BASE #if defined( __MWERKS__ ) && defined(__MACH__) #define WXWIN_OS_DESCRIPTION "MacOS X" @@ -347,22 +358,6 @@ bool wxShutdown(wxShutdownFlags wFlags) #if wxUSE_STREAMS -// ---------------------------------------------------------------------------- -// wxPipeInputStream: stream for reading from a pipe -// ---------------------------------------------------------------------------- - -class wxPipeInputStream : public wxFileInputStream -{ -public: - wxPipeInputStream(int fd) : wxFileInputStream(fd) { } - - // return TRUE if the pipe is still opened - bool IsOpened() const { return !Eof(); } - - // return TRUE if we have anything to read, don't block - virtual bool CanRead() const; -}; - bool wxPipeInputStream::CanRead() const { if ( m_lasterror == wxSTREAM_EOF ) @@ -399,10 +394,6 @@ bool wxPipeInputStream::CanRead() const } } -// define this to let wxexec.cpp know that we know what we're doing -#define _WX_USED_BY_WXEXECUTE_ -#include "../common/execcmn.cpp" - #endif // wxUSE_STREAMS // ---------------------------------------------------------------------------- @@ -586,6 +577,9 @@ long wxExecute(wxChar **argv, { ARGS_CLEANUP; + // save it for WaitForChild() use + execData.pid = pid; + // prepare for IO redirection #if wxUSE_STREAMS @@ -829,17 +823,6 @@ wxString wxGetOsDescription() #endif // !__WXMAC__ -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); -} - unsigned long wxGetProcessId() { return (unsigned long)getpid(); @@ -1061,7 +1044,7 @@ void wxFatalError( const wxString &msg, const wxString &title ) #endif // WXWIN_COMPATIBILITY_2_2 -#endif // __WXBASE__ +#endif // wxUSE_BASE #if wxUSE_GUI @@ -1183,6 +1166,9 @@ int wxGUIAppTraits::WaitForChild(wxExecuteData& execData) } } +#endif // wxUSE_GUI +#if wxUSE_BASE + void wxHandleProcessTermination(wxEndProcessData *proc_data) { // notify user about termination if required @@ -1203,5 +1189,5 @@ void wxHandleProcessTermination(wxEndProcessData *proc_data) } } -#endif // wxUSE_GUI +#endif // wxUSE_BASE