From 2887179b1fa36f13e7686aae3043893735667dca Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 26 Jun 2003 01:14:22 +0000 Subject: [PATCH] compilation fixes for separate build git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21420 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/unix/pipe.h | 22 ++++++++++++++++++++++ src/common/execcmn.cpp | 2 ++ src/unix/utilsunx.cpp | 28 ++++++++-------------------- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/include/wx/unix/pipe.h b/include/wx/unix/pipe.h index 93257ea456..972113ae36 100644 --- a/include/wx/unix/pipe.h +++ b/include/wx/unix/pipe.h @@ -94,5 +94,27 @@ private: int m_fds[2]; }; +#if wxUSE_STREAMS + +#include "wx/wfstream.h" + +// ---------------------------------------------------------------------------- +// 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; +}; + +#endif // wxUSE_STREAMS + #endif // _WX_UNIX_PIPE_H_ diff --git a/src/common/execcmn.cpp b/src/common/execcmn.cpp index d0566651e5..a282842090 100644 --- a/src/common/execcmn.cpp +++ b/src/common/execcmn.cpp @@ -81,6 +81,7 @@ inline void wxStreamTempInputBuffer::Init(wxPipeInputStream *stream) m_stream = stream; } +inline void wxStreamTempInputBuffer::Update() { if ( m_stream && m_stream->CanRead() ) @@ -104,6 +105,7 @@ void wxStreamTempInputBuffer::Update() } } +inline wxStreamTempInputBuffer::~wxStreamTempInputBuffer() { if ( m_buffer ) diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 2f15a8cb26..f216487e98 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -31,6 +31,14 @@ #include "wx/unix/execute.h" +#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 + #ifdef __WXBASE__ #if defined( __MWERKS__ ) && defined(__MACH__) @@ -347,22 +355,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 +391,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 // ---------------------------------------------------------------------------- -- 2.45.2