diff options
Diffstat (limited to 'libcxx/include/ios')
| -rw-r--r-- | libcxx/include/ios | 124 |
1 files changed, 64 insertions, 60 deletions
diff --git a/libcxx/include/ios b/libcxx/include/ios index 2eb32f296aaf..7c2ee83d4624 100644 --- a/libcxx/include/ios +++ b/libcxx/include/ios @@ -211,37 +211,40 @@ storage-class-specifier const error_category& iostream_category() noexcept; */ -#include <__config> - -#if _LIBCPP_HAS_LOCALIZATION - -# include <__fwd/ios.h> -# include <__ios/fpos.h> -# include <__locale> -# include <__memory/addressof.h> -# include <__system_error/error_category.h> -# include <__system_error/error_code.h> -# include <__system_error/error_condition.h> -# include <__system_error/system_error.h> -# include <__utility/swap.h> -# include <__verbose_abort> -# include <version> +#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS) +# include <__cxx03/ios> +#else +# include <__config> + +# if _LIBCPP_HAS_LOCALIZATION + +# include <__fwd/ios.h> +# include <__ios/fpos.h> +# include <__locale> +# include <__memory/addressof.h> +# include <__system_error/error_category.h> +# include <__system_error/error_code.h> +# include <__system_error/error_condition.h> +# include <__system_error/system_error.h> +# include <__utility/swap.h> +# include <__verbose_abort> +# include <version> // standard-mandated includes // [ios.syn] -# include <iosfwd> +# include <iosfwd> -# if _LIBCPP_HAS_ATOMIC_HEADER -# include <__atomic/atomic.h> // for __xindex_ -# endif +# if _LIBCPP_HAS_ATOMIC_HEADER +# include <__atomic/atomic.h> // for __xindex_ +# endif -# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -# endif +# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +# endif _LIBCPP_PUSH_MACROS -# include <__undef_macros> +# include <__undef_macros> _LIBCPP_BEGIN_NAMESPACE_STD @@ -284,20 +287,20 @@ public: static const openmode in = 0x08; static const openmode out = 0x10; static const openmode trunc = 0x20; -# if _LIBCPP_STD_VER >= 23 +# if _LIBCPP_STD_VER >= 23 static const openmode noreplace = 0x40; -# endif +# endif enum seekdir { beg, cur, end }; -# if _LIBCPP_STD_VER <= 14 +# if _LIBCPP_STD_VER <= 14 typedef iostate io_state; typedef openmode open_mode; typedef seekdir seek_dir; typedef std::streamoff streamoff; typedef std::streampos streampos; -# endif +# endif class _LIBCPP_EXPORTED_FROM_ABI Init; @@ -397,11 +400,11 @@ private: size_t __event_cap_; // TODO(EricWF): Enable this for both Clang and GCC. Currently it is only // enabled with clang. -# if _LIBCPP_HAS_C_ATOMIC_IMP && _LIBCPP_HAS_THREADS +# if _LIBCPP_HAS_C_ATOMIC_IMP && _LIBCPP_HAS_THREADS static atomic<int> __xindex_; -# else +# else static int __xindex_; -# endif +# endif long* __iarray_; size_t __iarray_size_; size_t __iarray_cap_; @@ -417,10 +420,10 @@ _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc) template <> struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc> : public true_type {}; -# ifdef _LIBCPP_CXX03_LANG +# ifdef _LIBCPP_CXX03_LANG template <> struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc::__lx> : public true_type {}; -# endif +# endif _LIBCPP_EXPORTED_FROM_ABI const error_category& iostream_category() _NOEXCEPT; @@ -441,11 +444,11 @@ public: }; [[__noreturn__]] inline _LIBCPP_HIDE_FROM_ABI void __throw_failure(char const* __msg) { -# if _LIBCPP_HAS_EXCEPTIONS +# if _LIBCPP_HAS_EXCEPTIONS throw ios_base::failure(__msg); -# else +# else _LIBCPP_VERBOSE_ABORT("ios_base::failure was thrown in -fno-exceptions mode with message \"%s\"", __msg); -# endif +# endif } class _LIBCPP_EXPORTED_FROM_ABI ios_base::Init { @@ -569,13 +572,13 @@ public: static_assert(is_same<_CharT, typename traits_type::char_type>::value, "traits_type::char_type must be the same type as CharT"); -# ifdef _LIBCPP_CXX03_LANG +# ifdef _LIBCPP_CXX03_LANG // Preserve the ability to compare with literal 0, // and implicitly convert to bool, but not implicitly convert to int. _LIBCPP_HIDE_FROM_ABI operator void*() const { return fail() ? nullptr : (void*)this; } -# else +# else _LIBCPP_HIDE_FROM_ABI explicit operator bool() const { return !fail(); } -# endif +# endif _LIBCPP_HIDE_FROM_ABI bool operator!() const { return fail(); } _LIBCPP_HIDE_FROM_ABI iostate rdstate() const { return ios_base::rdstate(); } @@ -625,11 +628,11 @@ protected: private: basic_ostream<char_type, traits_type>* __tie_; -# if defined(_LIBCPP_ABI_IOS_ALLOW_ARBITRARY_FILL_VALUE) +# if defined(_LIBCPP_ABI_IOS_ALLOW_ARBITRARY_FILL_VALUE) using _FillType = _FillHelper<traits_type>; -# else +# else using _FillType = _SentinelValueFill<traits_type>; -# endif +# endif mutable _FillType __fill_; }; @@ -744,9 +747,9 @@ inline _LIBCPP_HIDE_FROM_ABI void basic_ios<_CharT, _Traits>::set_rdbuf(basic_st extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>; -# if _LIBCPP_HAS_WIDE_CHARACTERS +# if _LIBCPP_HAS_WIDE_CHARACTERS extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>; -# endif +# endif _LIBCPP_HIDE_FROM_ABI inline ios_base& boolalpha(ios_base& __str) { __str.setf(ios_base::boolalpha); @@ -872,22 +875,23 @@ _LIBCPP_END_NAMESPACE_STD _LIBCPP_POP_MACROS -#endif // _LIBCPP_HAS_LOCALIZATION - -#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 -# include <atomic> -# include <concepts> -# include <cstddef> -# include <cstdlib> -# include <cstring> -# include <initializer_list> -# include <limits> -# include <mutex> -# include <new> -# include <stdexcept> -# include <system_error> -# include <type_traits> -# include <typeinfo> -#endif +# endif // _LIBCPP_HAS_LOCALIZATION + +# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 +# include <atomic> +# include <concepts> +# include <cstddef> +# include <cstdlib> +# include <cstring> +# include <initializer_list> +# include <limits> +# include <mutex> +# include <new> +# include <stdexcept> +# include <system_error> +# include <type_traits> +# include <typeinfo> +# endif +#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS) #endif // _LIBCPP_IOS |
