diff options
Diffstat (limited to 'system/include/libcxx/future')
-rw-r--r-- | system/include/libcxx/future | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/system/include/libcxx/future b/system/include/libcxx/future index 3d7bb6c9..dae1a4b8 100644 --- a/system/include/libcxx/future +++ b/system/include/libcxx/future @@ -403,6 +403,72 @@ _LIBCPP_DECLARE_STRONG_ENUM(launch) }; _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(launch) +#ifndef _LIBCPP_HAS_NO_STRONG_ENUMS + +#ifdef _LIBCXX_UNDERLYING_TYPE +typedef underlying_type<launch>::type __launch_underlying_type; +#else +typedef int __launch_underlying_type; +#endif + +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR +launch +operator&(launch __x, launch __y) +{ + return static_cast<launch>(static_cast<__launch_underlying_type>(__x) & + static_cast<__launch_underlying_type>(__y)); +} + +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR +launch +operator|(launch __x, launch __y) +{ + return static_cast<launch>(static_cast<__launch_underlying_type>(__x) | + static_cast<__launch_underlying_type>(__y)); +} + +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR +launch +operator^(launch __x, launch __y) +{ + return static_cast<launch>(static_cast<__launch_underlying_type>(__x) ^ + static_cast<__launch_underlying_type>(__y)); +} + +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR +launch +operator~(launch __x) +{ + return static_cast<launch>(~static_cast<__launch_underlying_type>(__x) & 3); +} + +inline _LIBCPP_INLINE_VISIBILITY +launch& +operator&=(launch& __x, launch __y) +{ + __x = __x & __y; return __x; +} + +inline _LIBCPP_INLINE_VISIBILITY +launch& +operator|=(launch& __x, launch __y) +{ + __x = __x | __y; return __x; +} + +inline _LIBCPP_INLINE_VISIBILITY +launch& +operator^=(launch& __x, launch __y) +{ + __x = __x ^ __y; return __x; +} + +#endif // !_LIBCPP_HAS_NO_STRONG_ENUMS + //enum class future_status _LIBCPP_DECLARE_STRONG_ENUM(future_status) { |