diff options
Diffstat (limited to 'libcxx/include/fstream')
| -rw-r--r-- | libcxx/include/fstream | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libcxx/include/fstream b/libcxx/include/fstream index 6d3f20fff688..04cebdedc31d 100644 --- a/libcxx/include/fstream +++ b/libcxx/include/fstream @@ -299,6 +299,16 @@ protected: int sync() override; void imbue(const locale& __loc) override; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL streamsize xsputn(const char_type* __str, streamsize __len) override { + if (__always_noconv_ && __len >= (this->epptr() - this->pbase())) { + if (traits_type::eq_int_type(overflow(), traits_type::eof())) + return 0; + + return std::fwrite(__str, sizeof(char_type), __len, __file_); + } + return basic_streambuf<_CharT, _Traits>::xsputn(__str, __len); + } + private: char* __extbuf_; const char* __extbufnext_; |
