VC6 compilation fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60501 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-05-03 09:29:22 +00:00
parent e4eef50be7
commit 9dfe9a1a12

View File

@@ -183,16 +183,6 @@ wxStdInputStreamBuffer::pbackfail(int c)
return m_stream.Ungetch((char) c) ? c : EOF;
}
// ==========================================================================
// wxStdInputStream
// ==========================================================================
wxStdInputStream::wxStdInputStream(wxInputStream& stream) :
std::istream(NULL), m_streamBuffer(stream)
{
std::ios::init(&m_streamBuffer);
}
// ==========================================================================
// wxStdOutputStreamBuffer
// ==========================================================================
@@ -260,13 +250,44 @@ wxStdOutputStreamBuffer::overflow(int c)
}
// ==========================================================================
// wxStdOutputStream
// wxStdInputStream and wxStdOutputStream
// ==========================================================================
// FIXME-VC6: it is impossible to call basic_ios<char>::init() with this
// compiler, it complains about invalid call to non-static member
// function so use a suspicious (as it uses a pointer to not yet
// constructed streambuf) but working workaround
//
// It also doesn't like using istream in the ctor initializer list
// and we must spell it out as basic_istream<char>.
#ifdef __VISUALC6__
wxStdInputStream::wxStdInputStream(wxInputStream& stream)
: std::basic_istream<char, std::char_traits<char> >(&m_streamBuffer),
m_streamBuffer(stream)
{
}
wxStdOutputStream::wxStdOutputStream(wxOutputStream& stream)
: std::basic_ostream<char, std::char_traits<char> >(&m_streamBuffer),
m_streamBuffer(stream)
{
}
#else // !VC6
wxStdInputStream::wxStdInputStream(wxInputStream& stream) :
std::istream(NULL), m_streamBuffer(stream)
{
std::ios::init(&m_streamBuffer);
}
wxStdOutputStream::wxStdOutputStream(wxOutputStream& stream) :
std::ostream(NULL), m_streamBuffer(stream)
{
std::ios::init(&m_streamBuffer);
}
#endif // VC6/!VC6
#endif // wxUSE_STD_IOSTREAM