summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/future
diff options
context:
space:
mode:
authortheraven <theraven@FreeBSD.org>2013-07-10 16:28:24 +0000
committertheraven <theraven@FreeBSD.org>2013-07-10 16:28:24 +0000
commit214e4f8fe625ad54aac3b215909e0b994a5768ec (patch)
treef757844d307e5ebbf92ab857f2376cceb7807147 /contrib/libc++/include/future
parentc660176671bf640bee3fd09dbfa32ad187a9b942 (diff)
downloadFreeBSD-src-214e4f8fe625ad54aac3b215909e0b994a5768ec.zip
FreeBSD-src-214e4f8fe625ad54aac3b215909e0b994a5768ec.tar.gz
Import new libcxxrt / libc++. This brings some bug fixes, including a potential race condition for static initialisers.
Diffstat (limited to 'contrib/libc++/include/future')
-rw-r--r--contrib/libc++/include/future66
1 files changed, 66 insertions, 0 deletions
diff --git a/contrib/libc++/include/future b/contrib/libc++/include/future
index 3d7bb6c..dae1a4b 100644
--- a/contrib/libc++/include/future
+++ b/contrib/libc++/include/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)
{
OpenPOWER on IntegriCloud