Renamed the symbol indicating whether pipe-based streams are available from
HAS_PIPE_INPUT_STREAM to HAS_PIPE_STREAMS as it's not really input-specific.
See #12636.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66151
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
# include <sys/select.h>
#endif
# include <sys/select.h>
#endif
-#define HAS_PIPE_INPUT_STREAM (wxUSE_STREAMS && wxUSE_FILE)
+#define HAS_PIPE_STREAMS (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
+#endif // HAS_PIPE_STREAMS
#if defined(__MWERKS__) && defined(__MACH__)
#ifndef WXWIN_OS_DESCRIPTION
#if defined(__MWERKS__) && defined(__MACH__)
#ifndef WXWIN_OS_DESCRIPTION
// 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
+#endif // HAS_PIPE_STREAMS
// ----------------------------------------------------------------------------
// wxShell
// ----------------------------------------------------------------------------
// wxShell
// 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,
// the input buffer bufOut is connected to stdout, this is why it is
// called bufOut and not bufIn
wxStreamTempInputBuffer bufOut,
execData.fdOut = fdOut;
execData.fdErr = fdErr;
}
execData.fdOut = fdOut;
execData.fdErr = fdErr;
}
-#endif // HAS_PIPE_INPUT_STREAM
+#endif // HAS_PIPE_STREAMS
bool wxAppTraits::CheckForRedirectedIO(wxExecuteData& execData)
{
bool wxAppTraits::CheckForRedirectedIO(wxExecuteData& execData)
{
-#if HAS_PIPE_INPUT_STREAM
bool hasIO = false;
if ( execData.bufOut && execData.bufOut->Update() )
bool hasIO = false;
if ( execData.bufOut && execData.bufOut->Update() )
hasIO = true;
return hasIO;
hasIO = true;
return hasIO;
-#else // !HAS_PIPE_INPUT_STREAM
+#else // !HAS_PIPE_STREAMS
wxUnusedVar(execData);
return false;
wxUnusedVar(execData);
return false;
-#endif // HAS_PIPE_INPUT_STREAM/!HAS_PIPE_INPUT_STREAM
+#endif // HAS_PIPE_STREAMS/!HAS_PIPE_STREAMS
}
// helper classes/functions used by WaitForChild()
}
// helper classes/functions used by WaitForChild()
wxDECLARE_NO_COPY_CLASS(wxEndHandler);
};
wxDECLARE_NO_COPY_CLASS(wxEndHandler);
};
-#if HAS_PIPE_INPUT_STREAM
// class for monitoring our ends of child stdout/err, should be constructed
// with the FD and stream from wxExecuteData and will do nothing if they're
// class for monitoring our ends of child stdout/err, should be constructed
// with the FD and stream from wxExecuteData and will do nothing if they're
wxDECLARE_NO_COPY_CLASS(wxRedirectedIOHandler);
};
wxDECLARE_NO_COPY_CLASS(wxRedirectedIOHandler);
};
-#endif // HAS_PIPE_INPUT_STREAM
+#endif // HAS_PIPE_STREAMS
// helper function which calls waitpid() and analyzes the result
int DoWaitForChild(int pid, int flags = 0)
// helper function which calls waitpid() and analyzes the result
int DoWaitForChild(int pid, int flags = 0)
}
//else: synchronous execution case
}
//else: synchronous execution case
-#if HAS_PIPE_INPUT_STREAM && wxUSE_SOCKETS
+#if HAS_PIPE_STREAMS && wxUSE_SOCKETS
wxProcess * const process = execData.process;
if ( process && process->IsRedirected() )
{
wxProcess * const process = execData.process;
if ( process && process->IsRedirected() )
{
}
}
//else: no IO redirection, just block waiting for the child to exit
}
}
//else: no IO redirection, just block waiting for the child to exit
-#endif // HAS_PIPE_INPUT_STREAM
+#endif // HAS_PIPE_STREAMS
return DoWaitForChild(execData.pid);
}
return DoWaitForChild(execData.pid);
}