diff options
Diffstat (limited to 'contrib/libc++/include/fstream')
-rw-r--r-- | contrib/libc++/include/fstream | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/contrib/libc++/include/fstream b/contrib/libc++/include/fstream index 3cb3b13..7bcc5d4 100644 --- a/contrib/libc++/include/fstream +++ b/contrib/libc++/include/fstream @@ -180,7 +180,7 @@ typedef basic_fstream<wchar_t> wfstream; _LIBCPP_BEGIN_NAMESPACE_STD template <class _CharT, class _Traits> -class _LIBCPP_TYPE_VIS_ONLY basic_filebuf +class _LIBCPP_TEMPLATE_VIS basic_filebuf : public basic_streambuf<_CharT, _Traits> { public: @@ -618,10 +618,9 @@ basic_filebuf<_CharT, _Traits>::underflow() size_t __nr = fread((void*)__extbufnext_, 1, __nmemb, __file_); if (__nr != 0) { -#ifndef _LIBCPP_NO_EXCEPTIONS if (!__cv_) - throw bad_cast(); -#endif + __throw_bad_cast(); + __extbufend_ = __extbufnext_ + __nr; char_type* __inext; __r = __cv_->in(__st_, __extbuf_, __extbufend_, __extbufnext_, @@ -700,10 +699,9 @@ basic_filebuf<_CharT, _Traits>::overflow(int_type __c) codecvt_base::result __r; do { -#ifndef _LIBCPP_NO_EXCEPTIONS if (!__cv_) - throw bad_cast(); -#endif + __throw_bad_cast(); + const char_type* __e; __r = __cv_->out(__st_, this->pbase(), this->pptr(), __e, __extbuf_, __extbuf_ + __ebs_, __extbe); @@ -793,10 +791,9 @@ typename basic_filebuf<_CharT, _Traits>::pos_type basic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode) { -#ifndef _LIBCPP_NO_EXCEPTIONS if (!__cv_) - throw bad_cast(); -#endif + __throw_bad_cast(); + int __width = __cv_->encoding(); if (__file_ == 0 || (__width <= 0 && __off != 0) || sync()) return pos_type(off_type(-1)); @@ -816,7 +813,7 @@ basic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way, default: return pos_type(off_type(-1)); } -#if defined(_WIN32) || defined(_NEWLIB_VERSION) +#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS) if (fseek(__file_, __width > 0 ? __width * __off : 0, __whence)) return pos_type(off_type(-1)); pos_type __r = ftell(__file_); @@ -835,7 +832,7 @@ basic_filebuf<_CharT, _Traits>::seekpos(pos_type __sp, ios_base::openmode) { if (__file_ == 0 || sync()) return pos_type(off_type(-1)); -#if defined(_WIN32) || defined(_NEWLIB_VERSION) +#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS) if (fseek(__file_, __sp, SEEK_SET)) return pos_type(off_type(-1)); #else @@ -852,10 +849,9 @@ basic_filebuf<_CharT, _Traits>::sync() { if (__file_ == 0) return 0; -#ifndef _LIBCPP_NO_EXCEPTIONS if (!__cv_) - throw bad_cast(); -#endif + __throw_bad_cast(); + if (__cm_ & ios_base::out) { if (this->pptr() != this->pbase()) @@ -900,7 +896,7 @@ basic_filebuf<_CharT, _Traits>::sync() } } } -#if defined(_WIN32) || defined(_NEWLIB_VERSION) +#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS) if (fseek(__file_, -__c, SEEK_CUR)) return -1; #else @@ -1003,7 +999,7 @@ basic_filebuf<_CharT, _Traits>::__write_mode() // basic_ifstream template <class _CharT, class _Traits> -class _LIBCPP_TYPE_VIS_ONLY basic_ifstream +class _LIBCPP_TEMPLATE_VIS basic_ifstream : public basic_istream<_CharT, _Traits> { public: @@ -1165,7 +1161,7 @@ basic_ifstream<_CharT, _Traits>::close() // basic_ofstream template <class _CharT, class _Traits> -class _LIBCPP_TYPE_VIS_ONLY basic_ofstream +class _LIBCPP_TEMPLATE_VIS basic_ofstream : public basic_ostream<_CharT, _Traits> { public: @@ -1325,7 +1321,7 @@ basic_ofstream<_CharT, _Traits>::close() // basic_fstream template <class _CharT, class _Traits> -class _LIBCPP_TYPE_VIS_ONLY basic_fstream +class _LIBCPP_TEMPLATE_VIS basic_fstream : public basic_iostream<_CharT, _Traits> { public: |