diff options
Diffstat (limited to 'contrib/libc++/include/fstream')
-rw-r--r-- | contrib/libc++/include/fstream | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/contrib/libc++/include/fstream b/contrib/libc++/include/fstream index 7bcc5d4..ffd5698 100644 --- a/contrib/libc++/include/fstream +++ b/contrib/libc++/include/fstream @@ -171,12 +171,14 @@ typedef basic_fstream<wchar_t> wfstream; #include <__locale> #include <cstdio> -#include <__undef_min_max> - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD template <class _CharT, class _Traits> @@ -193,13 +195,13 @@ public: // 27.9.1.2 Constructors/destructor: basic_filebuf(); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG basic_filebuf(basic_filebuf&& __rhs); #endif virtual ~basic_filebuf(); // 27.9.1.3 Assign/swap: -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_filebuf& operator=(basic_filebuf&& __rhs); #endif @@ -276,7 +278,7 @@ basic_filebuf<_CharT, _Traits>::basic_filebuf() setbuf(0, 4096); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> basic_filebuf<_CharT, _Traits>::basic_filebuf(basic_filebuf&& __rhs) @@ -352,7 +354,7 @@ basic_filebuf<_CharT, _Traits>::operator=(basic_filebuf&& __rhs) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> basic_filebuf<_CharT, _Traits>::~basic_filebuf() @@ -615,7 +617,7 @@ basic_filebuf<_CharT, _Traits>::underflow() static_cast<size_t>(__extbufend_ - __extbufnext_)); codecvt_base::result __r; __st_last_ = __st_; - size_t __nr = fread((void*)__extbufnext_, 1, __nmemb, __file_); + size_t __nr = fread((void*) const_cast<char *>(__extbufnext_), 1, __nmemb, __file_); if (__nr != 0) { if (!__cv_) @@ -628,7 +630,8 @@ basic_filebuf<_CharT, _Traits>::underflow() this->eback() + __ibs_, __inext); if (__r == codecvt_base::noconv) { - this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, (char_type*)__extbufend_); + this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, + (char_type*)const_cast<char *>(__extbufend_)); __c = traits_type::to_int_type(*this->gptr()); } else if (__inext != this->eback() + __unget_sz) @@ -720,7 +723,7 @@ basic_filebuf<_CharT, _Traits>::overflow(int_type __c) return traits_type::eof(); if (__r == codecvt_base::partial) { - this->setp((char_type*)__e, this->pptr()); + this->setp(const_cast<char_type*>(__e), this->pptr()); this->pbump(this->epptr() - this->pbase()); } } @@ -1017,12 +1020,10 @@ public: _LIBCPP_INLINE_VISIBILITY explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in); #endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_ifstream(basic_ifstream&& __rhs); -#endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY basic_ifstream& operator=(basic_ifstream&& __rhs); #endif @@ -1071,7 +1072,7 @@ basic_ifstream<_CharT, _Traits>::basic_ifstream(const string& __s, ios_base::ope } #endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> inline @@ -1092,7 +1093,7 @@ basic_ifstream<_CharT, _Traits>::operator=(basic_ifstream&& __rhs) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> inline @@ -1177,12 +1178,10 @@ public: explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out); _LIBCPP_INLINE_VISIBILITY explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_ofstream(basic_ofstream&& __rhs); -#endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY basic_ofstream& operator=(basic_ofstream&& __rhs); #endif @@ -1231,7 +1230,7 @@ basic_ofstream<_CharT, _Traits>::basic_ofstream(const string& __s, ios_base::ope } #endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> inline @@ -1252,7 +1251,7 @@ basic_ofstream<_CharT, _Traits>::operator=(basic_ofstream&& __rhs) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> inline @@ -1339,12 +1338,10 @@ public: _LIBCPP_INLINE_VISIBILITY explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out); #endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_fstream(basic_fstream&& __rhs); -#endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY basic_fstream& operator=(basic_fstream&& __rhs); #endif @@ -1393,7 +1390,7 @@ basic_fstream<_CharT, _Traits>::basic_fstream(const string& __s, ios_base::openm } #endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> inline @@ -1414,7 +1411,7 @@ basic_fstream<_CharT, _Traits>::operator=(basic_fstream&& __rhs) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> inline @@ -1482,4 +1479,6 @@ basic_fstream<_CharT, _Traits>::close() _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP_FSTREAM |