X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eb3a3cbbd3da3d03476de447e4cf1f7818e56b50..661698e54f2bc599dc1a961ffbae08ccdd6b9b97:/include/wx/stdstream.h?ds=sidebyside diff --git a/include/wx/stdstream.h b/include/wx/stdstream.h index a973bbb768..27d48d5c8b 100644 --- a/include/wx/stdstream.h +++ b/include/wx/stdstream.h @@ -14,7 +14,7 @@ #include "wx/defs.h" // wxUSE_STD_IOSTREAM -#if wxUSE_STD_IOSTREAM +#if wxUSE_STREAMS && wxUSE_STD_IOSTREAM #include "wx/defs.h" #include "wx/stream.h" @@ -47,6 +47,18 @@ protected: 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; }; @@ -106,6 +118,6 @@ protected: wxStdOutputStreamBuffer m_streamBuffer; }; -#endif // wxUSE_STD_IOSTREAM +#endif // wxUSE_STREAMS && wxUSE_STD_IOSTREAM #endif // _WX_STDSTREAM_H_