diff options
author | dim <dim@FreeBSD.org> | 2014-01-30 07:44:22 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-01-30 07:44:22 +0000 |
commit | 0b319638e352dd16f2e5a243bd3826d37eef1680 (patch) | |
tree | add3759d4df7ee10d814c3b2561c3c28fcd9cef2 /contrib/libc++/include/__std_stream | |
parent | 9cecf9778c1472e916ad20086c11e4bf332ba6ad (diff) | |
parent | c3e10da3dc0f616b78ccf85206fdcf4c92f8ac85 (diff) | |
download | FreeBSD-src-0b319638e352dd16f2e5a243bd3826d37eef1680.zip FreeBSD-src-0b319638e352dd16f2e5a243bd3826d37eef1680.tar.gz |
Import libc++ 3.4 release. This contains a lot of bugfixes, and some
preliminary support for C++1y.
MFC after: 3 weeks
Diffstat (limited to 'contrib/libc++/include/__std_stream')
-rw-r--r-- | contrib/libc++/include/__std_stream | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/libc++/include/__std_stream b/contrib/libc++/include/__std_stream index cff4331..5403ada 100644 --- a/contrib/libc++/include/__std_stream +++ b/contrib/libc++/include/__std_stream @@ -233,6 +233,7 @@ public: protected: virtual int_type overflow (int_type __c = traits_type::eof()); + virtual streamsize xsputn(const char_type* __s, streamsize __n); virtual int sync(); virtual void imbue(const locale& __loc); @@ -309,6 +310,19 @@ __stdoutbuf<_CharT>::overflow(int_type __c) } template <class _CharT> +streamsize +__stdoutbuf<_CharT>::xsputn(const char_type* __s, streamsize __n) +{ + if (__always_noconv_) + return fwrite(__s, sizeof(char_type), __n, __file_); + streamsize __i = 0; + for (; __i < __n; ++__i, ++__s) + if (overflow(traits_type::to_int_type(*__s)) == traits_type::eof()) + break; + return __i; +} + +template <class _CharT> int __stdoutbuf<_CharT>::sync() { |