diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-04-01 16:01:04 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-04-01 16:01:04 -0700 |
commit | 00c2e03551a61ca76bdb303f1c007845f8a6dbd6 (patch) | |
tree | 51a3fb38eff156561441960606533fd0c1be71df | |
parent | 36600f34ef0ec2cf75165be3753567e256f514db (diff) | |
parent | 2787d1f7d01afb598ed56c4d52dab876e0a34a74 (diff) |
Merge pull request #1009 from waywardmonkeys/another-libcxx-update1.3.6
Another libcxx update
81 files changed, 991 insertions, 898 deletions
diff --git a/system/include/libcxx/__bit_reference b/system/include/libcxx/__bit_reference index 8180295b..1621deb8 100644 --- a/system/include/libcxx/__bit_reference +++ b/system/include/libcxx/__bit_reference @@ -81,6 +81,16 @@ class __bit_reference<_Cp, false> { }; +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY inline +void +swap(__bit_reference<_Cp> __x, __bit_reference<_Cp> __y) _NOEXCEPT +{ + bool __t = __x; + __x = __y; + __y = __t; +} + template <class _Cp, class _Dp> _LIBCPP_INLINE_VISIBILITY inline void diff --git a/system/include/libcxx/__config b/system/include/libcxx/__config index 8617b866..959390d5 100644 --- a/system/include/libcxx/__config +++ b/system/include/libcxx/__config @@ -11,7 +11,7 @@ #ifndef _LIBCPP_CONFIG #define _LIBCPP_CONFIG -#if !_MSC_VER // explicit macro necessary because it is only defined below in this file +#ifndef _MSC_VER // explicit macro necessary because it is only defined below in this file #pragma GCC system_header #endif @@ -96,24 +96,27 @@ # endif #endif // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN) -#if _WIN32 +#ifdef _WIN32 // only really useful for a DLL #ifdef _LIBCPP_DLL // this should be a compiler builtin define ideally... # ifdef cxx_EXPORTS # define _LIBCPP_HIDDEN -# define _LIBCPP_VISIBLE __declspec(dllexport) +# define _LIBCPP_FUNC_VIS __declspec(dllexport) +# define _LIBCPP_TYPE_VIS __declspec(dllexport) # else # define _LIBCPP_HIDDEN -# define _LIBCPP_VISIBLE __declspec(dllimport) +# define _LIBCPP_FUNC_VIS __declspec(dllimport) +# define _LIBCPP_TYPE_VIS __declspec(dllimport) # endif #else # define _LIBCPP_HIDDEN -# define _LIBCPP_VISIBLE +# define _LIBCPP_FUNC_VIS +# define _LIBCPP_TYPE_VIS #endif #ifndef _LIBCPP_INLINE_VISIBILITY -# if _MSC_VER +# ifdef _MSC_VER # define _LIBCPP_INLINE_VISIBILITY __forceinline # else // MinGW GCC and Clang # define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__)) @@ -121,11 +124,11 @@ #endif #ifndef _LIBCPP_EXCEPTION_ABI -#define _LIBCPP_EXCEPTION_ABI _LIBCPP_VISIBLE +#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS #endif #ifndef _LIBCPP_ALWAYS_INLINE -# if _MSC_VER +# ifdef _MSC_VER # define _LIBCPP_ALWAYS_INLINE __forceinline # endif #endif @@ -136,8 +139,16 @@ #define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden"))) #endif -#ifndef _LIBCPP_VISIBLE -#define _LIBCPP_VISIBLE __attribute__ ((__visibility__("default"))) +#ifndef _LIBCPP_FUNC_VIS +#define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default"))) +#endif + +#ifndef _LIBCPP_TYPE_VIS +# if __has_attribute(type_visibility) +# define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default"))) +# else +# define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) +# endif #endif #ifndef _LIBCPP_INLINE_VISIBILITY @@ -145,7 +156,7 @@ #endif #ifndef _LIBCPP_EXCEPTION_ABI -#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default"))) +#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS #endif #ifndef _LIBCPP_CANTTHROW @@ -261,7 +272,7 @@ typedef __char32_t char32_t; #define _LIBCPP_HAS_NO_CONSTEXPR #endif -#if __FreeBSD__ && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L) +#if defined(__FreeBSD__) && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L) #define _LIBCPP_HAS_QUICK_EXIT #define _LIBCPP_HAS_C11_FEATURES #endif @@ -424,7 +435,7 @@ template <unsigned> struct __static_assert_check {}; #endif #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS -#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_VISIBLE x { enum __lx +#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \ __lx __v_; \ _LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \ @@ -432,7 +443,7 @@ template <unsigned> struct __static_assert_check {}; _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \ }; #else // _LIBCPP_HAS_NO_STRONG_ENUMS -#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_VISIBLE x +#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_TYPE_VIS x #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) #endif // _LIBCPP_HAS_NO_STRONG_ENUMS @@ -440,18 +451,18 @@ template <unsigned> struct __static_assert_check {}; #define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__; #endif -#if __APPLE__ || __FreeBSD__ || _WIN32 || __sun__ +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__) #define _LIBCPP_LOCALE__L_EXTENSIONS 1 #endif -#if __FreeBSD__ +#ifdef __FreeBSD__ #define _DECLARE_C99_LDBL_MATH 1 #endif -#if __APPLE__ || __FreeBSD__ +#if defined(__APPLE__) || defined(__FreeBSD__) #define _LIBCPP_HAS_DEFAULTRUNELOCALE #endif -#if __APPLE__ || __FreeBSD__ || __sun__ +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__) #define _LIBCPP_WCTYPE_IS_MASK #endif diff --git a/system/include/libcxx/__debug b/system/include/libcxx/__debug index 4a0e3cec..0d631bf0 100644 --- a/system/include/libcxx/__debug +++ b/system/include/libcxx/__debug @@ -16,7 +16,9 @@ # include <cstdlib> # include <cstdio> # include <cstddef> -# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort())) +# ifndef _LIBCPP_ASSERT +# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort())) +# endif #endif @@ -24,9 +26,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD -struct _LIBCPP_VISIBLE __c_node; +struct _LIBCPP_TYPE_VIS __c_node; -struct _LIBCPP_VISIBLE __i_node +struct _LIBCPP_TYPE_VIS __i_node { void* __i_; __i_node* __next_; @@ -40,7 +42,7 @@ struct _LIBCPP_VISIBLE __i_node ~__i_node(); }; -struct _LIBCPP_VISIBLE __c_node +struct _LIBCPP_TYPE_VIS __c_node { void* __c_; __c_node* __next_; @@ -117,7 +119,7 @@ _C_node<_Cont>::__subscriptable(const void* __i, ptrdiff_t __n) const return _Cp->__subscriptable(__j, __n); } -class _LIBCPP_VISIBLE __libcpp_db +class _LIBCPP_TYPE_VIS __libcpp_db { __c_node** __cbeg_; __c_node** __cend_; @@ -176,11 +178,11 @@ private: _LIBCPP_HIDDEN __i_node* __find_iterator(const void* __i) const; - friend _LIBCPP_VISIBLE __libcpp_db* __get_db(); + friend _LIBCPP_FUNC_VIS __libcpp_db* __get_db(); }; -_LIBCPP_VISIBLE __libcpp_db* __get_db(); -_LIBCPP_VISIBLE const __libcpp_db* __get_const_db(); +_LIBCPP_FUNC_VIS __libcpp_db* __get_db(); +_LIBCPP_FUNC_VIS const __libcpp_db* __get_const_db(); _LIBCPP_END_NAMESPACE_STD diff --git a/system/include/libcxx/__functional_03 b/system/include/libcxx/__functional_03 index 3a5397d8..b52d6926 100644 --- a/system/include/libcxx/__functional_03 +++ b/system/include/libcxx/__functional_03 @@ -203,7 +203,7 @@ class _LIBCPP_EXCEPTION_ABI bad_function_call { }; -template<class _Fp> class _LIBCPP_VISIBLE function; // undefined +template<class _Fp> class _LIBCPP_TYPE_VIS function; // undefined namespace __function { @@ -644,7 +644,7 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::target_type() const } // __function template<class _Rp> -class _LIBCPP_VISIBLE function<_Rp()> +class _LIBCPP_TYPE_VIS function<_Rp()> { typedef __function::__base<_Rp()> __base; aligned_storage<3*sizeof(void*)>::type __buf_; @@ -928,7 +928,7 @@ function<_Rp()>::target() const #endif // _LIBCPP_NO_RTTI template<class _Rp, class _A0> -class _LIBCPP_VISIBLE function<_Rp(_A0)> +class _LIBCPP_TYPE_VIS function<_Rp(_A0)> : public unary_function<_A0, _Rp> { typedef __function::__base<_Rp(_A0)> __base; @@ -1230,7 +1230,7 @@ function<_Rp(_A0)>::target() const #endif // _LIBCPP_NO_RTTI template<class _Rp, class _A0, class _A1> -class _LIBCPP_VISIBLE function<_Rp(_A0, _A1)> +class _LIBCPP_TYPE_VIS function<_Rp(_A0, _A1)> : public binary_function<_A0, _A1, _Rp> { typedef __function::__base<_Rp(_A0, _A1)> __base; @@ -1532,7 +1532,7 @@ function<_Rp(_A0, _A1)>::target() const #endif // _LIBCPP_NO_RTTI template<class _Rp, class _A0, class _A1, class _A2> -class _LIBCPP_VISIBLE function<_Rp(_A0, _A1, _A2)> +class _LIBCPP_TYPE_VIS function<_Rp(_A0, _A1, _A2)> { typedef __function::__base<_Rp(_A0, _A1, _A2)> __base; aligned_storage<3*sizeof(void*)>::type __buf_; @@ -1860,11 +1860,11 @@ swap(function<_Fp>& __x, function<_Fp>& __y) {return __x.swap(__y);} template<class _Tp> struct __is_bind_expression : public false_type {}; -template<class _Tp> struct _LIBCPP_VISIBLE is_bind_expression +template<class _Tp> struct _LIBCPP_TYPE_VIS is_bind_expression : public __is_bind_expression<typename remove_cv<_Tp>::type> {}; template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {}; -template<class _Tp> struct _LIBCPP_VISIBLE is_placeholder +template<class _Tp> struct _LIBCPP_TYPE_VIS is_placeholder : public __is_placeholder<typename remove_cv<_Tp>::type> {}; namespace placeholders diff --git a/system/include/libcxx/__functional_base b/system/include/libcxx/__functional_base index 2385459c..40a63a85 100644 --- a/system/include/libcxx/__functional_base +++ b/system/include/libcxx/__functional_base @@ -23,21 +23,21 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _Arg, class _Result> -struct _LIBCPP_VISIBLE unary_function +struct _LIBCPP_TYPE_VIS unary_function { typedef _Arg argument_type; typedef _Result result_type; }; template <class _Arg1, class _Arg2, class _Result> -struct _LIBCPP_VISIBLE binary_function +struct _LIBCPP_TYPE_VIS binary_function { typedef _Arg1 first_argument_type; typedef _Arg2 second_argument_type; typedef _Result result_type; }; -template <class _Tp> struct _LIBCPP_VISIBLE hash; +template <class _Tp> struct _LIBCPP_TYPE_VIS hash; template <class _Tp> struct __has_result_type @@ -51,7 +51,7 @@ public: }; template <class _Tp> -struct _LIBCPP_VISIBLE less : binary_function<_Tp, _Tp, bool> +struct _LIBCPP_TYPE_VIS less : binary_function<_Tp, _Tp, bool> { _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const _Tp& __y) const {return __x < __y;} @@ -348,7 +348,7 @@ struct __invoke_return }; template <class _Tp> -class _LIBCPP_VISIBLE reference_wrapper +class _LIBCPP_TYPE_VIS reference_wrapper : public __weak_result_type<_Tp> { public: diff --git a/system/include/libcxx/__functional_base_03 b/system/include/libcxx/__functional_base_03 index a1005bf7..11165a96 100644 --- a/system/include/libcxx/__functional_base_03 +++ b/system/include/libcxx/__functional_base_03 @@ -996,7 +996,7 @@ struct __invoke_return2 }; template <class _Tp> -class _LIBCPP_VISIBLE reference_wrapper +class _LIBCPP_TYPE_VIS reference_wrapper : public __weak_result_type<_Tp> { public: diff --git a/system/include/libcxx/__hash_table b/system/include/libcxx/__hash_table index ba04b3e5..6f6050d3 100644 --- a/system/include/libcxx/__hash_table +++ b/system/include/libcxx/__hash_table @@ -26,7 +26,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -_LIBCPP_VISIBLE +_LIBCPP_FUNC_VIS size_t __next_prime(size_t __n); template <class _NodePtr> @@ -80,14 +80,14 @@ __next_pow2(size_t __n) } template <class _Tp, class _Hash, class _Equal, class _Alloc> class __hash_table; -template <class _ConstNodePtr> class _LIBCPP_VISIBLE __hash_const_iterator; -template <class _HashIterator> class _LIBCPP_VISIBLE __hash_map_iterator; -template <class _HashIterator> class _LIBCPP_VISIBLE __hash_map_const_iterator; +template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS __hash_const_iterator; +template <class _HashIterator> class _LIBCPP_TYPE_VIS __hash_map_iterator; +template <class _HashIterator> class _LIBCPP_TYPE_VIS __hash_map_const_iterator; template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> - class _LIBCPP_VISIBLE unordered_map; + class _LIBCPP_TYPE_VIS unordered_map; template <class _NodePtr> -class _LIBCPP_VISIBLE __hash_iterator +class _LIBCPP_TYPE_VIS __hash_iterator { typedef _NodePtr __node_pointer; @@ -142,14 +142,14 @@ private: {} template <class, class, class, class> friend class __hash_table; - template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator; - template <class> friend class _LIBCPP_VISIBLE __hash_map_iterator; - template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_map; - template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap; + template <class> friend class _LIBCPP_TYPE_VIS __hash_const_iterator; + template <class> friend class _LIBCPP_TYPE_VIS __hash_map_iterator; + template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_map; + template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS unordered_multimap; }; template <class _ConstNodePtr> -class _LIBCPP_VISIBLE __hash_const_iterator +class _LIBCPP_TYPE_VIS __hash_const_iterator { typedef _ConstNodePtr __node_pointer; @@ -220,15 +220,15 @@ private: {} template <class, class, class, class> friend class __hash_table; - template <class> friend class _LIBCPP_VISIBLE __hash_map_const_iterator; - template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_map; - template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap; + template <class> friend class _LIBCPP_TYPE_VIS __hash_map_const_iterator; + template <class, class, class, cl |