wxPipeInputStream depends on wxFile, use wxUSE_FILE
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -39,13 +39,15 @@
|
|||||||
|
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
#if wxUSE_STREAMS
|
#define HAS_PIPE_INPUT_STREAM (wxUSE_STREAMS && wxUSE_FILE)
|
||||||
|
|
||||||
|
#if HAS_PIPE_INPUT_STREAM
|
||||||
|
|
||||||
// define this to let wxexec.cpp know that we know what we're doing
|
// define this to let wxexec.cpp know that we know what we're doing
|
||||||
#define _WX_USED_BY_WXEXECUTE_
|
#define _WX_USED_BY_WXEXECUTE_
|
||||||
#include "../common/execcmn.cpp"
|
#include "../common/execcmn.cpp"
|
||||||
|
|
||||||
#endif // wxUSE_STREAMS
|
#endif // HAS_PIPE_INPUT_STREAM
|
||||||
|
|
||||||
#if wxUSE_BASE
|
#if wxUSE_BASE
|
||||||
|
|
||||||
@@ -407,7 +409,7 @@ bool wxShutdown(wxShutdownFlags wFlags)
|
|||||||
// wxStream classes to support IO redirection in wxExecute
|
// wxStream classes to support IO redirection in wxExecute
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if wxUSE_STREAMS
|
#if HAS_PIPE_INPUT_STREAM
|
||||||
|
|
||||||
bool wxPipeInputStream::CanRead() const
|
bool wxPipeInputStream::CanRead() const
|
||||||
{
|
{
|
||||||
@@ -447,7 +449,7 @@ bool wxPipeInputStream::CanRead() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_STREAMS
|
#endif // HAS_PIPE_INPUT_STREAM
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxExecute: the real worker function
|
// wxExecute: the real worker function
|
||||||
@@ -631,16 +633,16 @@ long wxExecute(wxChar **argv, int flags, wxProcess *process)
|
|||||||
|
|
||||||
// prepare for IO redirection
|
// prepare for IO redirection
|
||||||
|
|
||||||
#if wxUSE_STREAMS
|
#if HAS_PIPE_INPUT_STREAM
|
||||||
// the input buffer bufOut is connected to stdout, this is why it is
|
// the input buffer bufOut is connected to stdout, this is why it is
|
||||||
// called bufOut and not bufIn
|
// called bufOut and not bufIn
|
||||||
wxStreamTempInputBuffer bufOut,
|
wxStreamTempInputBuffer bufOut,
|
||||||
bufErr;
|
bufErr;
|
||||||
#endif // wxUSE_STREAMS
|
#endif // HAS_PIPE_INPUT_STREAM
|
||||||
|
|
||||||
if ( process && process->IsRedirected() )
|
if ( process && process->IsRedirected() )
|
||||||
{
|
{
|
||||||
#if wxUSE_STREAMS
|
#if HAS_PIPE_INPUT_STREAM
|
||||||
wxOutputStream *inStream =
|
wxOutputStream *inStream =
|
||||||
new wxFileOutputStream(pipeIn.Detach(wxPipe::Write));
|
new wxFileOutputStream(pipeIn.Detach(wxPipe::Write));
|
||||||
|
|
||||||
@@ -657,7 +659,7 @@ long wxExecute(wxChar **argv, int flags, wxProcess *process)
|
|||||||
|
|
||||||
execData.bufOut = &bufOut;
|
execData.bufOut = &bufOut;
|
||||||
execData.bufErr = &bufErr;
|
execData.bufErr = &bufErr;
|
||||||
#endif // wxUSE_STREAMS
|
#endif // HAS_PIPE_INPUT_STREAM
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( pipeIn.IsOk() )
|
if ( pipeIn.IsOk() )
|
||||||
@@ -1172,7 +1174,7 @@ int wxGUIAppTraits::WaitForChild(wxExecuteData& execData)
|
|||||||
{
|
{
|
||||||
bool idle = true;
|
bool idle = true;
|
||||||
|
|
||||||
#if wxUSE_STREAMS
|
#if HAS_PIPE_INPUT_STREAM
|
||||||
if ( execData.bufOut )
|
if ( execData.bufOut )
|
||||||
{
|
{
|
||||||
execData.bufOut->Update();
|
execData.bufOut->Update();
|
||||||
@@ -1184,7 +1186,7 @@ int wxGUIAppTraits::WaitForChild(wxExecuteData& execData)
|
|||||||
execData.bufErr->Update();
|
execData.bufErr->Update();
|
||||||
idle = false;
|
idle = false;
|
||||||
}
|
}
|
||||||
#endif // wxUSE_STREAMS
|
#endif // HAS_PIPE_INPUT_STREAM
|
||||||
|
|
||||||
// don't consume 100% of the CPU while we're sitting in this
|
// don't consume 100% of the CPU while we're sitting in this
|
||||||
// loop
|
// loop
|
||||||
|
Reference in New Issue
Block a user