// wxInputStream and wxOutputStream
// Author: Jonathan Liu <net147@gmail.com>
// Created: 2009-05-02
-// RCS-ID: $Id$
// Copyright: (c) 2009 Jonathan Liu
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/defs.h" // wxUSE_STD_IOSTREAM
-#if wxUSE_STD_IOSTREAM
+#if wxUSE_STREAMS && wxUSE_STD_IOSTREAM
-#include <iosfwd>
-#include <wx/defs.h>
-#include <wx/stream.h>
+#include "wx/defs.h"
+#include "wx/stream.h"
+#include "wx/ioswrap.h"
// ==========================================================================
// wxStdInputStreamBuffer
virtual int uflow();
virtual int pbackfail(int c = EOF);
+ // Special work around for VC8/9 (this bug was fixed in VC10 and later):
+ // these versions have non-standard _Xsgetn_s() that it being called from
+ // the stream code instead of xsgetn() and so our overridden implementation
+ // never actually gets used. To work around this, forward to it explicitly.
+#if defined(__VISUALC8__) || defined(__VISUALC9__)
+ virtual std::streamsize
+ _Xsgetn_s(char *s, size_t WXUNUSED(size), std::streamsize n)
+ {
+ return xsgetn(s, n);
+ }
+#endif // VC8 or VC9
+
wxInputStream& m_stream;
int m_lastChar;
};
wxStdOutputStreamBuffer m_streamBuffer;
};
-#endif // wxUSE_STD_IOSTREAM
+#endif // wxUSE_STREAMS && wxUSE_STD_IOSTREAM
#endif // _WX_STDSTREAM_H_