git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40519
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
+#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 _WX_USED_BY_WXEXECUTE_
#include "../common/execcmn.cpp"
// define this to let wxexec.cpp know that we know what we're doing
#define _WX_USED_BY_WXEXECUTE_
#include "../common/execcmn.cpp"
+#endif // HAS_PIPE_INPUT_STREAM
// wxStream classes to support IO redirection in wxExecute
// ----------------------------------------------------------------------------
// wxStream classes to support IO redirection in wxExecute
// ----------------------------------------------------------------------------
+#if HAS_PIPE_INPUT_STREAM
bool wxPipeInputStream::CanRead() const
{
bool wxPipeInputStream::CanRead() const
{
+#endif // HAS_PIPE_INPUT_STREAM
// ----------------------------------------------------------------------------
// wxExecute: the real worker function
// ----------------------------------------------------------------------------
// wxExecute: the real worker function
// prepare for IO redirection
// prepare for IO redirection
+#if HAS_PIPE_INPUT_STREAM
// the input buffer bufOut is connected to stdout, this is why it is
// called bufOut and not bufIn
wxStreamTempInputBuffer bufOut,
bufErr;
// the input buffer bufOut is connected to stdout, this is why it is
// called bufOut and not bufIn
wxStreamTempInputBuffer bufOut,
bufErr;
+#endif // HAS_PIPE_INPUT_STREAM
if ( process && process->IsRedirected() )
{
if ( process && process->IsRedirected() )
{
+#if HAS_PIPE_INPUT_STREAM
wxOutputStream *inStream =
new wxFileOutputStream(pipeIn.Detach(wxPipe::Write));
wxOutputStream *inStream =
new wxFileOutputStream(pipeIn.Detach(wxPipe::Write));
execData.bufOut = &bufOut;
execData.bufErr = &bufErr;
execData.bufOut = &bufOut;
execData.bufErr = &bufErr;
+#endif // HAS_PIPE_INPUT_STREAM
+#if HAS_PIPE_INPUT_STREAM
if ( execData.bufOut )
{
execData.bufOut->Update();
if ( execData.bufOut )
{
execData.bufOut->Update();
execData.bufErr->Update();
idle = false;
}
execData.bufErr->Update();
idle = false;
}
+#endif // HAS_PIPE_INPUT_STREAM
// don't consume 100% of the CPU while we're sitting in this
// loop
// don't consume 100% of the CPU while we're sitting in this
// loop