[libcxx-commits] [libcxx] b22aa3d - [libc++][NFC] Rename _LIBCPP_NO_EXCEPTIONS to _LIBCPP_HAS_NO_EXCEPTIONS
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Feb 17 08:39:10 PST 2023
Author: Nikolas Klauser
Date: 2023-02-17T17:39:03+01:00
New Revision: b22aa3d74f276afbfbd10953de68e3b4f8cef907
URL: https://github.com/llvm/llvm-project/commit/b22aa3d74f276afbfbd10953de68e3b4f8cef907
DIFF: https://github.com/llvm/llvm-project/commit/b22aa3d74f276afbfbd10953de68e3b4f8cef907.diff
LOG: [libc++][NFC] Rename _LIBCPP_NO_EXCEPTIONS to _LIBCPP_HAS_NO_EXCEPTIONS
Other macros that disable parts of the library are named `_LIBCPP_HAS_NO_WHATEVER`.
Reviewed By: ldionne, Mordante, #libc
Spies: libcxx-commits, smeenai
Differential Revision: https://reviews.llvm.org/D143163
Added:
Modified:
libcxx/include/__availability
libcxx/include/__config
libcxx/include/__expected/expected.h
libcxx/include/__filesystem/filesystem_error.h
libcxx/include/__format/format_error.h
libcxx/include/__functional/function.h
libcxx/include/__hash_table
libcxx/include/__iterator/counted_iterator.h
libcxx/include/__memory/shared_ptr.h
libcxx/include/__memory/uninitialized_algorithms.h
libcxx/include/__split_buffer
libcxx/include/__utility/exception_guard.h
libcxx/include/any
libcxx/include/deque
libcxx/include/exception
libcxx/include/forward_list
libcxx/include/fstream
libcxx/include/future
libcxx/include/iomanip
libcxx/include/ios
libcxx/include/istream
libcxx/include/list
libcxx/include/new
libcxx/include/optional
libcxx/include/ostream
libcxx/include/regex
libcxx/include/sstream
libcxx/include/stdexcept
libcxx/include/string
libcxx/include/typeinfo
libcxx/include/valarray
libcxx/include/variant
libcxx/include/vector
libcxx/src/filesystem/filesystem_common.h
libcxx/src/future.cpp
libcxx/src/ios.cpp
libcxx/src/locale.cpp
libcxx/src/mutex.cpp
libcxx/src/new.cpp
libcxx/src/string.cpp
libcxx/src/support/runtime/exception_fallback.ipp
libcxx/src/support/runtime/exception_msvc.ipp
libcxx/src/system_error.cpp
Removed:
################################################################################
diff --git a/libcxx/include/__availability b/libcxx/include/__availability
index 6dfca3fa8b1ab..bd1c92ae73dbb 100644
--- a/libcxx/include/__availability
+++ b/libcxx/include/__availability
@@ -270,10 +270,10 @@
#endif
-// Define availability attributes that depend on _LIBCPP_NO_EXCEPTIONS.
+// Define availability attributes that depend on _LIBCPP_HAS_NO_EXCEPTIONS.
// Those are defined in terms of the availability attributes above, and
// should not be vendor-specific.
-#if defined(_LIBCPP_NO_EXCEPTIONS)
+#if defined(_LIBCPP_HAS_NO_EXCEPTIONS)
# define _LIBCPP_AVAILABILITY_FUTURE
# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 403cc3aa983d1..6790fb3c7ec2e 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -448,7 +448,7 @@ typedef __char32_t char32_t;
# endif
# if !defined(__cpp_exceptions) || __cpp_exceptions < 199711L
-# define _LIBCPP_NO_EXCEPTIONS
+# define _LIBCPP_HAS_NO_EXCEPTIONS
# endif
# define _LIBCPP_PREFERRED_ALIGNOF(_Tp) __alignof(_Tp)
diff --git a/libcxx/include/__expected/expected.h b/libcxx/include/__expected/expected.h
index ca3e8a59922d0..8bb04071b1230 100644
--- a/libcxx/include/__expected/expected.h
+++ b/libcxx/include/__expected/expected.h
@@ -64,7 +64,7 @@ namespace __expected {
template <class _Err, class _Arg>
_LIBCPP_HIDE_FROM_ABI void __throw_bad_expected_access(_Arg&& __arg) {
-# ifndef _LIBCPP_NO_EXCEPTIONS
+# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_expected_access<_Err>(std::forward<_Arg>(__arg));
# else
(void)__arg;
diff --git a/libcxx/include/__filesystem/filesystem_error.h b/libcxx/include/__filesystem/filesystem_error.h
index effe6998338cb..70e39541e73ff 100644
--- a/libcxx/include/__filesystem/filesystem_error.h
+++ b/libcxx/include/__filesystem/filesystem_error.h
@@ -86,7 +86,7 @@ _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
template <class... _Args>
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
void __throw_filesystem_error(_Args&&... __args) {
throw filesystem_error(_VSTD::forward<_Args>(__args)...);
}
diff --git a/libcxx/include/__format/format_error.h b/libcxx/include/__format/format_error.h
index 9f77acc0ac877..5f9b7daf805ea 100644
--- a/libcxx/include/__format/format_error.h
+++ b/libcxx/include/__format/format_error.h
@@ -40,7 +40,7 @@ class _LIBCPP_EXCEPTION_ABI format_error : public runtime_error {
_LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI void
__throw_format_error(const char* __s) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw format_error(__s);
#else
(void)__s;
diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h
index f8023df210db2..d7cc07e7355b6 100644
--- a/libcxx/include/__functional/function.h
+++ b/libcxx/include/__functional/function.h
@@ -68,7 +68,7 @@ _LIBCPP_DIAGNOSTIC_POP
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_bad_function_call()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_function_call();
#else
_VSTD::abort();
diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table
index 54754c957d26d..19a47e0d04ce0 100644
--- a/libcxx/include/__hash_table
+++ b/libcxx/include/__hash_table
@@ -1597,10 +1597,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
if (bucket_count() != 0)
{
__next_pointer __cache = __detach();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
const_iterator __i = __u.begin();
while (__cache != nullptr && __u.size() != 0)
{
@@ -1610,14 +1610,14 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
__node_insert_multi(__cache->__upcast());
__cache = __next;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__deallocate_node(__cache);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__deallocate_node(__cache);
}
const_iterator __i = __u.begin();
@@ -1659,10 +1659,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_unique(_InputIterator __first
if (bucket_count() != 0)
{
__next_pointer __cache = __detach();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __cache != nullptr && __first != __last; ++__first)
{
__cache->__upcast()->__value_ = *__first;
@@ -1670,14 +1670,14 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_unique(_InputIterator __first
__node_insert_unique(__cache->__upcast());
__cache = __next;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__deallocate_node(__cache);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__deallocate_node(__cache);
}
for (; __first != __last; ++__first)
@@ -1699,10 +1699,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __first,
if (bucket_count() != 0)
{
__next_pointer __cache = __detach();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __cache != nullptr && __first != __last; ++__first)
{
__cache->__upcast()->__value_ = *__first;
@@ -1710,14 +1710,14 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __first,
__node_insert_multi(__cache->__upcast());
__cache = __next;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__deallocate_node(__cache);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__deallocate_node(__cache);
}
for (; __first != __last; ++__first)
diff --git a/libcxx/include/__iterator/counted_iterator.h b/libcxx/include/__iterator/counted_iterator.h
index d3d483271959c..ad69a5c90e68d 100644
--- a/libcxx/include/__iterator/counted_iterator.h
+++ b/libcxx/include/__iterator/counted_iterator.h
@@ -143,12 +143,12 @@ class counted_iterator
decltype(auto) operator++(int) {
_LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end.");
--__count_;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try { return __current_++; }
catch(...) { ++__count_; throw; }
#else
return __current_++;
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
_LIBCPP_HIDE_FROM_ABI
diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h
index e8000b8ad0ca6..3ef264dcfe48c 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -118,7 +118,7 @@ class _LIBCPP_EXCEPTION_ABI bad_weak_ptr
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_bad_weak_ptr()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_weak_ptr();
#else
_VSTD::abort();
@@ -508,10 +508,10 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
shared_ptr(_Yp* __p, _Dp __d)
: __ptr_(__p)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT> _CntrlBlk;
#ifndef _LIBCPP_CXX03_LANG
@@ -520,14 +520,14 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
__cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
#endif // not _LIBCPP_CXX03_LANG
__enable_weak_this(__p, __p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__d(__p);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Yp, class _Dp, class _Alloc, class = __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, _Tp>::value> >
@@ -535,10 +535,10 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
shared_ptr(_Yp* __p, _Dp __d, _Alloc __a)
: __ptr_(__p)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef __shared_ptr_pointer<_Yp*, _Dp, _Alloc> _CntrlBlk;
typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
typedef __allocator_destructor<_A2> _D2;
@@ -552,14 +552,14 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
#endif // not _LIBCPP_CXX03_LANG
__cntrl_ = _VSTD::addressof(*__hold2.release());
__enable_weak_this(__p, __p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__d(__p);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Dp>
@@ -567,10 +567,10 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
shared_ptr(nullptr_t __p, _Dp __d)
: __ptr_(nullptr)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef typename __shared_ptr_default_allocator<_Tp>::type _AllocT;
typedef __shared_ptr_pointer<nullptr_t, _Dp, _AllocT> _CntrlBlk;
#ifndef _LIBCPP_CXX03_LANG
@@ -578,14 +578,14 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
#else
__cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
#endif // not _LIBCPP_CXX03_LANG
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__d(__p);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Dp, class _Alloc>
@@ -593,10 +593,10 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a)
: __ptr_(nullptr)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef __shared_ptr_pointer<nullptr_t, _Dp, _Alloc> _CntrlBlk;
typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
typedef __allocator_destructor<_A2> _D2;
@@ -609,14 +609,14 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
_CntrlBlk(__p, __d, __a);
#endif // not _LIBCPP_CXX03_LANG
__cntrl_ = _VSTD::addressof(*__hold2.release());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__d(__p);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Yp>
diff --git a/libcxx/include/__memory/uninitialized_algorithms.h b/libcxx/include/__memory/uninitialized_algorithms.h
index ea4fe4da73597..d860cee509779 100644
--- a/libcxx/include/__memory/uninitialized_algorithms.h
+++ b/libcxx/include/__memory/uninitialized_algorithms.h
@@ -58,12 +58,12 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
__uninitialized_copy(_InputIterator __ifirst, _Sentinel1 __ilast,
_ForwardIterator __ofirst, _Sentinel2 __olast) {
_ForwardIterator __idx = __ofirst;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __ifirst != __ilast && __idx != __olast; ++__ifirst, (void)++__idx)
::new (_VSTD::__voidify(*__idx)) _ValueType(*__ifirst);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__ofirst, __idx);
throw;
@@ -90,12 +90,12 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
__uninitialized_copy_n(_InputIterator __ifirst, _Size __n,
_ForwardIterator __ofirst, _Sentinel __olast) {
_ForwardIterator __idx = __ofirst;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __n > 0 && __idx != __olast; ++__ifirst, (void)++__idx, (void)--__n)
::new (_VSTD::__voidify(*__idx)) _ValueType(*__ifirst);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__ofirst, __idx);
throw;
@@ -121,13 +121,13 @@ inline _LIBCPP_HIDE_FROM_ABI
_ForwardIterator __uninitialized_fill(_ForwardIterator __first, _Sentinel __last, const _Tp& __x)
{
_ForwardIterator __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
for (; __idx != __last; ++__idx)
::new (_VSTD::__voidify(*__idx)) _ValueType(__x);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -154,13 +154,13 @@ inline _LIBCPP_HIDE_FROM_ABI
_ForwardIterator __uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
{
_ForwardIterator __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
for (; __n > 0; ++__idx, (void) --__n)
::new (_VSTD::__voidify(*__idx)) _ValueType(__x);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -188,12 +188,12 @@ template <class _ValueType, class _ForwardIterator, class _Sentinel>
inline _LIBCPP_HIDE_FROM_ABI
_ForwardIterator __uninitialized_default_construct(_ForwardIterator __first, _Sentinel __last) {
auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __idx != __last; ++__idx)
::new (_VSTD::__voidify(*__idx)) _ValueType;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__first, __idx);
throw;
@@ -217,12 +217,12 @@ template <class _ValueType, class _ForwardIterator, class _Size>
inline _LIBCPP_HIDE_FROM_ABI
_ForwardIterator __uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {
auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __n > 0; ++__idx, (void) --__n)
::new (_VSTD::__voidify(*__idx)) _ValueType;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__first, __idx);
throw;
@@ -245,12 +245,12 @@ template <class _ValueType, class _ForwardIterator, class _Sentinel>
inline _LIBCPP_HIDE_FROM_ABI
_ForwardIterator __uninitialized_value_construct(_ForwardIterator __first, _Sentinel __last) {
auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __idx != __last; ++__idx)
::new (_VSTD::__voidify(*__idx)) _ValueType();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__first, __idx);
throw;
@@ -274,12 +274,12 @@ template <class _ValueType, class _ForwardIterator, class _Size>
inline _LIBCPP_HIDE_FROM_ABI
_ForwardIterator __uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {
auto __idx = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __n > 0; ++__idx, (void) --__n)
::new (_VSTD::__voidify(*__idx)) _ValueType();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__first, __idx);
throw;
@@ -304,13 +304,13 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
__uninitialized_move(_InputIterator __ifirst, _Sentinel1 __ilast,
_ForwardIterator __ofirst, _Sentinel2 __olast, _IterMove __iter_move) {
auto __idx = __ofirst;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __ifirst != __ilast && __idx != __olast; ++__idx, (void)++__ifirst) {
::new (_VSTD::__voidify(*__idx)) _ValueType(__iter_move(__ifirst));
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__ofirst, __idx);
throw;
@@ -338,12 +338,12 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator>
__uninitialized_move_n(_InputIterator __ifirst, _Size __n,
_ForwardIterator __ofirst, _Sentinel __olast, _IterMove __iter_move) {
auto __idx = __ofirst;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
#endif
for (; __n > 0 && __idx != __olast; ++__idx, (void)++__ifirst, --__n)
::new (_VSTD::__voidify(*__idx)) _ValueType(__iter_move(__ifirst));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
_VSTD::__destroy(__ofirst, __idx);
throw;
@@ -600,7 +600,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Iter2 __uninitialized_alloc
auto __guard =
std::__make_exception_guard(_AllocatorDestroyRangeReverse<_Alloc, _Iter2>(__alloc, __destruct_first, __first2));
while (__first1 != __last1) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
allocator_traits<_Alloc>::construct(__alloc, std::__to_address(__first2), std::move_if_noexcept(*__first1));
#else
allocator_traits<_Alloc>::construct(__alloc, std::__to_address(__first2), std::move(*__first1));
diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer
index 7d0beda277ada..c3b161f8f97b3 100644
--- a/libcxx/include/__split_buffer
+++ b/libcxx/include/__split_buffer
@@ -463,10 +463,10 @@ __split_buffer<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
{
if (capacity() > size())
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__split_buffer<value_type, __alloc_rr&> __t(size(), 0, __alloc());
__t.__construct_at_end(move_iterator<pointer>(__begin_),
move_iterator<pointer>(__end_));
@@ -475,12 +475,12 @@ __split_buffer<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
_VSTD::swap(__begin_, __t.__begin_);
_VSTD::swap(__end_, __t.__end_);
_VSTD::swap(__end_cap(), __t.__end_cap());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
diff --git a/libcxx/include/__utility/exception_guard.h b/libcxx/include/__utility/exception_guard.h
index f7d1d4b309efe..1db8f8af1bf02 100644
--- a/libcxx/include/__utility/exception_guard.h
+++ b/libcxx/include/__utility/exception_guard.h
@@ -41,7 +41,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// less common, especially one that tries to catch an exception through -fno-exceptions code.
//
// __exception_guard can help greatly simplify code that would normally be cluttered by
-// `#if _LIBCPP_NO_EXCEPTIONS`. For example:
+// `#if _LIBCPP_HAS_NO_EXCEPTIONS`. For example:
//
// template <class Iterator, class Size, class OutputIterator>
// Iterator uninitialized_copy_n(Iterator iter, Size n, OutputIterator out) {
@@ -121,7 +121,7 @@ struct __exception_guard_noexceptions {
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__exception_guard_noexceptions);
-#ifdef _LIBCPP_NO_EXCEPTIONS
+#ifdef _LIBCPP_HAS_NO_EXCEPTIONS
template <class _Rollback>
using __exception_guard = __exception_guard_noexceptions<_Rollback>;
#else
diff --git a/libcxx/include/any b/libcxx/include/any
index f93dbbbc7ca92..423628736b382 100644
--- a/libcxx/include/any
+++ b/libcxx/include/any
@@ -117,7 +117,7 @@ _LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
void __throw_bad_any_cast()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_any_cast();
#else
_VSTD::abort();
diff --git a/libcxx/include/deque b/libcxx/include/deque
index ed5a6152085fe..2dbbe81f3f074 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -1879,13 +1879,13 @@ deque<_Tp, _Allocator>::__add_front_capacity(size_type __n)
__buf(std::max<size_type>(2* __map_.capacity(),
__nb + __map_.size()),
0, __map_.__alloc());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __nb > 0; --__nb)
__buf.push_back(__alloc_traits::allocate(__a, __block_size));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1894,7 +1894,7 @@ deque<_Tp, _Allocator>::__add_front_capacity(size_type __n)
__alloc_traits::deallocate(__a, *__i, __block_size);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __back_capacity > 0; --__back_capacity)
{
__buf.push_back(__map_.back());
@@ -2021,13 +2021,13 @@ deque<_Tp, _Allocator>::__add_back_capacity(size_type __n)
__nb + __map_.size()),
__map_.size() - __front_capacity,
__map_.__alloc());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __nb > 0; --__nb)
__buf.push_back(__alloc_traits::allocate(__a, __block_size));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -2036,7 +2036,7 @@ deque<_Tp, _Allocator>::__add_back_capacity(size_type __n)
__alloc_traits::deallocate(__a, *__i, __block_size);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __front_capacity > 0; --__front_capacity)
{
__buf.push_back(__map_.front());
diff --git a/libcxx/include/exception b/libcxx/include/exception
index e0f42682b5792..2b08f11fbf332 100644
--- a/libcxx/include/exception
+++ b/libcxx/include/exception
@@ -221,7 +221,7 @@ template<class _Ep>
_LIBCPP_INLINE_VISIBILITY exception_ptr
make_exception_ptr(_Ep __e) _NOEXCEPT
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
throw __e;
@@ -304,7 +304,7 @@ struct __nested
_LIBCPP_INLINE_VISIBILITY explicit __nested(const _Tp& __t) : _Tp(__t) {}
};
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
template <class _Tp, class _Up, bool>
struct __throw_with_nested;
@@ -336,7 +336,7 @@ _LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI
void
throw_with_nested(_Tp&& __t)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
typedef typename decay<_Tp>::type _Up;
static_assert( is_copy_constructible<_Up>::value, "type thrown must be CopyConstructible");
__throw_with_nested<_Tp, _Up,
diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list
index bcf21c64abc6b..43519b5fa51f0 100644
--- a/libcxx/include/forward_list
+++ b/libcxx/include/forward_list
@@ -1237,17 +1237,17 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, size_type __n,
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
__node_pointer __first = __h.release();
__node_pointer __last = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (--__n; __n != 0; --__n, __last = __last->__next_)
{
__h.reset(__node_traits::allocate(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
__last->__next_ = __h.release();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1260,7 +1260,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, size_type __n,
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__last->__next_ = __r->__next_;
__r->__next_ = __first;
__r = static_cast<__begin_node_pointer>(__last);
@@ -1283,17 +1283,17 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p,
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f);
__node_pointer __first = __h.release();
__node_pointer __last = __first;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (++__f; __f != __l; ++__f, ((void)(__last = __last->__next_)))
{
__h.reset(__node_traits::allocate(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f);
__last->__next_ = __h.release();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1306,7 +1306,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p,
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__last->__next_ = __r->__next_;
__r->__next_ = __first;
__r = static_cast<__begin_node_pointer>(__last);
diff --git a/libcxx/include/fstream b/libcxx/include/fstream
index 41e95bf3dc669..98094d8757ea9 100644
--- a/libcxx/include/fstream
+++ b/libcxx/include/fstream
@@ -398,17 +398,17 @@ basic_filebuf<_CharT, _Traits>::operator=(basic_filebuf&& __rhs)
template <class _CharT, class _Traits>
basic_filebuf<_CharT, _Traits>::~basic_filebuf()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
close();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (__owns_eb_)
delete [] __extbuf_;
if (__owns_ib_)
diff --git a/libcxx/include/future b/libcxx/include/future
index eda0a773cb493..a82efeb84cef8 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -520,12 +520,12 @@ public:
};
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
_LIBCPP_AVAILABILITY_FUTURE_ERROR
#endif
void __throw_future_error(future_errc __ev)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw future_error(make_error_code(__ev));
#else
((void)__ev);
@@ -869,18 +869,18 @@ template <class _Rp, class _Fp>
void
__deferred_assoc_state<_Rp, _Fp>::__execute()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->set_value(__func_());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _Fp>
@@ -910,19 +910,19 @@ template <class _Fp>
void
__deferred_assoc_state<void, _Fp>::__execute()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__func_();
this->set_value();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _Rp, class _Fp>
@@ -952,18 +952,18 @@ template <class _Rp, class _Fp>
void
__async_assoc_state<_Rp, _Fp>::__execute()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->set_value(__func_());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _Rp, class _Fp>
@@ -1001,19 +1001,19 @@ template <class _Fp>
void
__async_assoc_state<void, _Fp>::__execute()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__func_();
this->set_value();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _Fp>
@@ -1950,18 +1950,18 @@ packaged_task<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __args)
__throw_future_error(future_errc::no_state);
if (__p_.__state_->__has_value())
__throw_future_error(future_errc::promise_already_satisfied);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__p_.set_value(__f_(_VSTD::forward<_ArgTypes>(__args)...));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__p_.set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Rp, class ..._ArgTypes>
@@ -1972,18 +1972,18 @@ packaged_task<_Rp(_ArgTypes...)>::make_ready_at_thread_exit(_ArgTypes... __args)
__throw_future_error(future_errc::no_state);
if (__p_.__state_->__has_value())
__throw_future_error(future_errc::promise_already_satisfied);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__p_.set_value_at_thread_exit(__f_(_VSTD::forward<_ArgTypes>(__args)...));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__p_.set_exception_at_thread_exit(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class _Rp, class ..._ArgTypes>
@@ -2075,19 +2075,19 @@ packaged_task<void(_ArgTypes...)>::operator()(_ArgTypes... __args)
__throw_future_error(future_errc::no_state);
if (__p_.__state_->__has_value())
__throw_future_error(future_errc::promise_already_satisfied);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__f_(_VSTD::forward<_ArgTypes>(__args)...);
__p_.set_value();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__p_.set_exception(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class ..._ArgTypes>
@@ -2098,19 +2098,19 @@ packaged_task<void(_ArgTypes...)>::make_ready_at_thread_exit(_ArgTypes... __args
__throw_future_error(future_errc::no_state);
if (__p_.__state_->__has_value())
__throw_future_error(future_errc::promise_already_satisfied);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__f_(_VSTD::forward<_ArgTypes>(__args)...);
__p_.set_value_at_thread_exit();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__p_.set_exception_at_thread_exit(current_exception());
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class ..._ArgTypes>
@@ -2195,14 +2195,14 @@ async(launch __policy, _Fp&& __f, _Args&&... __args)
typedef __async_func<typename decay<_Fp>::type, typename decay<_Args>::type...> _BF;
typedef typename _BF::_Rp _Rp;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
if (__does_policy_contain(__policy, launch::async))
return _VSTD::__make_async_assoc_state<_Rp>(_BF(_LIBCPP_AUTO_CAST(_VSTD::forward<_Fp>(__f)),
_LIBCPP_AUTO_CAST(_VSTD::forward<_Args>(__args))...));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch ( ... ) { if (__policy == launch::async) throw ; }
#endif
diff --git a/libcxx/include/iomanip b/libcxx/include/iomanip
index 16d3bdfd0e970..bf8fbfe2a16f8 100644
--- a/libcxx/include/iomanip
+++ b/libcxx/include/iomanip
@@ -301,10 +301,10 @@ template <class _CharT, class _Traits, class _MoneyT>
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_MoneyT>& __x)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s)
{
@@ -315,13 +315,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_MoneyT>& __x)
__mf.get(_Ip(__is), _Ip(), __x.__intl_, __is, __err, __x.__mon_);
__is.setstate(__err);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__is.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __is;
}
@@ -361,10 +361,10 @@ template <class _CharT, class _Traits, class _MoneyT>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_MoneyT>& __x)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
@@ -374,13 +374,13 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_MoneyT>& __x)
if (__mf.put(_Op(__os), __x.__intl_, __os, __os.fill(), __x.__mon_).failed())
__os.setstate(ios_base::badbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __os;
}
@@ -420,10 +420,10 @@ template <class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t9<_CharT>& __x)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s)
{
@@ -435,13 +435,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t9<_CharT>& __x)
__x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_));
__is.setstate(__err);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__is.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __is;
}
@@ -481,10 +481,10 @@ template <class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t10<_CharT>& __x)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
@@ -495,13 +495,13 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t10<_CharT>& __x)
__x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_)).failed())
__os.setstate(ios_base::badbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __os;
}
diff --git a/libcxx/include/ios b/libcxx/include/ios
index 9eecf4d8dd8f4..bc478a11bd22b 100644
--- a/libcxx/include/ios
+++ b/libcxx/include/ios
@@ -448,7 +448,7 @@ public:
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_failure(char const* __msg) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw ios_base::failure(__msg);
#else
((void)__msg);
diff --git a/libcxx/include/istream b/libcxx/include/istream
index 12b12af7da642..831d4ecaabe5f 100644
--- a/libcxx/include/istream
+++ b/libcxx/include/istream
@@ -360,14 +360,14 @@ __input_arithmetic(basic_istream<_CharT, _Traits>& __is, _Tp& __n) {
typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef istreambuf_iterator<_CharT, _Traits> _Ip;
typedef num_get<_CharT, _Ip> _Fp;
std::use_facet<_Fp>(__is.getloc()).get(_Ip(__is), _Ip(), __is, __state, __n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -469,10 +469,10 @@ __input_arithmetic_with_numeric_limits(basic_istream<_CharT, _Traits>& __is, _Tp
typename basic_istream<_CharT, _Traits>::sentry __s(__is);
if (__s)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef istreambuf_iterator<_CharT, _Traits> _Ip;
typedef num_get<_CharT, _Ip> _Fp;
long __temp;
@@ -491,7 +491,7 @@ __input_arithmetic_with_numeric_limits(basic_istream<_CharT, _Traits>& __is, _Tp
{
__n = static_cast<_Tp>(__temp);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -502,7 +502,7 @@ __input_arithmetic_with_numeric_limits(basic_istream<_CharT, _Traits>& __is, _Tp
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__is.setstate(__state);
}
return __is;
@@ -531,7 +531,7 @@ __input_c_string(basic_istream<_CharT, _Traits>& __is, _CharT* __p, size_t __n)
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -555,7 +555,7 @@ __input_c_string(basic_istream<_CharT, _Traits>& __is, _CharT* __p, size_t __n)
__is.width(0);
if (__s == __p)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -640,7 +640,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -649,7 +649,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
__state |= ios_base::eofbit | ios_base::failbit;
else
__c = _Traits::to_char_type(__i);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -693,10 +693,10 @@ basic_istream<_CharT, _Traits>::operator>>(basic_streambuf<char_type, traits_typ
{
if (__sb)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
while (true)
{
typename traits_type::int_type __i = this->rdbuf()->sgetc();
@@ -714,7 +714,7 @@ basic_istream<_CharT, _Traits>::operator>>(basic_streambuf<char_type, traits_typ
}
if (__gc_ == 0)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -728,7 +728,7 @@ basic_istream<_CharT, _Traits>::operator>>(basic_streambuf<char_type, traits_typ
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
{
@@ -749,7 +749,7 @@ basic_istream<_CharT, _Traits>::get()
sentry __s(*this, true);
if (__s)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -758,7 +758,7 @@ basic_istream<_CharT, _Traits>::get()
__state |= ios_base::failbit | ios_base::eofbit;
else
__gc_ = 1;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -785,7 +785,7 @@ basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __
{
if (__n > 0)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -806,7 +806,7 @@ basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __
}
if (__gc_ == 0)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -845,10 +845,10 @@ basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __s
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
while (true)
{
typename traits_type::int_type __i = this->rdbuf()->sgetc();
@@ -865,14 +865,14 @@ basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __s
++__gc_;
this->rdbuf()->sbumpc();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__state |= ios_base::badbit;
// according to the spec, exceptions here are caught but not rethrown
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (__gc_ == 0)
__state |= ios_base::failbit;
this->setstate(__state);
@@ -889,10 +889,10 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
while (true)
{
typename traits_type::int_type __i = this->rdbuf()->sgetc();
@@ -917,7 +917,7 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ
this->rdbuf()->sbumpc();
++__gc_;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -932,7 +932,7 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
if (__n > 0)
*__s = char_type();
@@ -951,10 +951,10 @@ basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (__n == numeric_limits<streamsize>::max())
{
while (true)
@@ -985,7 +985,7 @@ basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)
break;
}
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -996,7 +996,7 @@ basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return *this;
@@ -1012,14 +1012,14 @@ basic_istream<_CharT, _Traits>::peek()
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__r = this->rdbuf()->sgetc();
if (traits_type::eq_int_type(__r, traits_type::eof()))
__state |= ios_base::eofbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1030,7 +1030,7 @@ basic_istream<_CharT, _Traits>::peek()
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return __r;
@@ -1045,14 +1045,14 @@ basic_istream<_CharT, _Traits>::read(char_type* __s, streamsize __n)
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__gc_ = this->rdbuf()->sgetn(__s, __n);
if (__gc_ != __n)
__state |= ios_base::failbit | ios_base::eofbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1063,7 +1063,7 @@ basic_istream<_CharT, _Traits>::read(char_type* __s, streamsize __n)
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
{
@@ -1082,10 +1082,10 @@ basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
streamsize __c = this->rdbuf()->in_avail();
switch (__c)
{
@@ -1101,7 +1101,7 @@ basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
__state |= ios_base::failbit | ios_base::eofbit;
break;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1112,7 +1112,7 @@ basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
{
@@ -1132,13 +1132,13 @@ basic_istream<_CharT, _Traits>::putback(char_type __c)
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf() == nullptr || this->rdbuf()->sputbackc(__c) == traits_type::eof())
__state |= ios_base::badbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1149,7 +1149,7 @@ basic_istream<_CharT, _Traits>::putback(char_type __c)
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
{
@@ -1169,13 +1169,13 @@ basic_istream<_CharT, _Traits>::unget()
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf() == nullptr || this->rdbuf()->sungetc() == traits_type::eof())
__state |= ios_base::badbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1186,7 +1186,7 @@ basic_istream<_CharT, _Traits>::unget()
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
{
@@ -1205,10 +1205,10 @@ basic_istream<_CharT, _Traits>::sync()
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf() == nullptr)
return -1;
if (this->rdbuf()->pubsync() == -1)
@@ -1216,7 +1216,7 @@ basic_istream<_CharT, _Traits>::sync()
__state |= ios_base::badbit;
return -1;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1227,7 +1227,7 @@ basic_istream<_CharT, _Traits>::sync()
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return __r;
@@ -1242,12 +1242,12 @@ basic_istream<_CharT, _Traits>::tellg()
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__r = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1258,7 +1258,7 @@ basic_istream<_CharT, _Traits>::tellg()
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return __r;
@@ -1273,13 +1273,13 @@ basic_istream<_CharT, _Traits>::seekg(pos_type __pos)
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf()->pubseekpos(__pos, ios_base::in) == pos_type(-1))
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1290,7 +1290,7 @@ basic_istream<_CharT, _Traits>::seekg(pos_type __pos)
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return *this;
@@ -1305,13 +1305,13 @@ basic_istream<_CharT, _Traits>::seekg(off_type __off, ios_base::seekdir __dir)
sentry __sen(*this, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf()->pubseekoff(__off, __dir, ios_base::in) == pos_type(-1))
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1322,7 +1322,7 @@ basic_istream<_CharT, _Traits>::seekg(off_type __off, ios_base::seekdir __dir)
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
this->setstate(__state);
}
return *this;
@@ -1336,10 +1336,10 @@ ws(basic_istream<_CharT, _Traits>& __is)
typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__is.getloc());
while (true)
{
@@ -1353,7 +1353,7 @@ ws(basic_istream<_CharT, _Traits>& __is)
break;
__is.rdbuf()->sbumpc();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1364,7 +1364,7 @@ ws(basic_istream<_CharT, _Traits>& __is)
throw;
}
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__is.setstate(__state);
}
return __is;
@@ -1450,7 +1450,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -1480,7 +1480,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
__is.width(0);
if (__c == 0)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1506,7 +1506,7 @@ getline(basic_istream<_CharT, _Traits>& __is,
typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -1533,7 +1533,7 @@ getline(basic_istream<_CharT, _Traits>& __is,
}
if (__extr == 0)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1585,7 +1585,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
if (__sen)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
#endif
@@ -1612,7 +1612,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
__x = bitset<_Size>(__str);
if (_Size > 0 && __c == 0)
__state |= ios_base::failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
diff --git a/libcxx/include/list b/libcxx/include/list
index 74d13dcb4ff13..0f02c99240d6b 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -1423,10 +1423,10 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
__r = iterator(__hold->__as_link(), this);
__hold.release();
iterator __e = __r;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (--__n; __n != 0; --__n, (void) ++__e, ++__ds)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
@@ -1435,7 +1435,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
__hold->__prev_ = __e.__ptr_;
__hold.release();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1450,7 +1450,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
@@ -1476,10 +1476,10 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
__r = iterator(__hold.get()->__as_link(), this);
__hold.release();
iterator __e = __r;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (++__f; __f != __l; ++__f, (void) ++__e, ++__ds)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
@@ -1488,7 +1488,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
__hold->__prev_ = __e.__ptr_;
__hold.release();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1503,7 +1503,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__link_nodes(__p.__ptr_, __r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
@@ -1787,10 +1787,10 @@ list<_Tp, _Alloc>::resize(size_type __n)
++__ds;
iterator __r = iterator(__hold.release()->__as_link(), this);
iterator __e = __r;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (--__n; __n != 0; --__n, (void) ++__e, ++__ds)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
@@ -1799,7 +1799,7 @@ list<_Tp, _Alloc>::resize(size_type __n)
__hold->__prev_ = __e.__ptr_;
__hold.release();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1814,7 +1814,7 @@ list<_Tp, _Alloc>::resize(size_type __n)
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__link_nodes_at_back(__r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
@@ -1837,10 +1837,10 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
__link_pointer __nl = __hold.release()->__as_link();
iterator __r = iterator(__nl, this);
iterator __e = __r;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (--__n; __n != 0; --__n, (void) ++__e, ++__ds)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
@@ -1849,7 +1849,7 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
__hold->__prev_ = __e.__ptr_;
__hold.release();
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -1864,7 +1864,7 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
}
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__link_nodes(base::__end_as_link(), __r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
diff --git a/libcxx/include/new b/libcxx/include/new
index 1c560808e60ab..be8033e33db91 100644
--- a/libcxx/include/new
+++ b/libcxx/include/new
@@ -173,7 +173,7 @@ _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_bad_alloc(); // not in C++ spec
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_bad_array_new_length()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_array_new_length();
#else
_VSTD::abort();
diff --git a/libcxx/include/optional b/libcxx/include/optional
index 738fc0ef5ca12..bbc8229c03316 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -208,7 +208,7 @@ _LIBCPP_NORETURN
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
void __throw_bad_optional_access() {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_optional_access();
#else
_VSTD::abort();
diff --git a/libcxx/include/ostream b/libcxx/include/ostream
index 06930a872c581..d2e422b328fd4 100644
--- a/libcxx/include/ostream
+++ b/libcxx/include/ostream
@@ -314,18 +314,18 @@ basic_ostream<_CharT, _Traits>::sentry::~sentry()
if (__os_.rdbuf() && __os_.good() && (__os_.flags() & ios_base::unitbuf)
&& !uncaught_exception())
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (__os_.rdbuf()->pubsync() == -1)
__os_.setstate(ios_base::badbit);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -352,19 +352,19 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(basic_streambuf<char_type, traits_type>* __sb)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
if (__sb)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef istreambuf_iterator<_CharT, _Traits> _Ip;
typedef ostreambuf_iterator<_CharT, _Traits> _Op;
_Ip __i(__sb);
@@ -379,24 +379,24 @@ basic_ostream<_CharT, _Traits>::operator<<(basic_streambuf<char_type, traits_typ
}
if (__c == 0)
this->setstate(ios_base::failbit);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_failbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
this->setstate(ios_base::badbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -404,10 +404,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(bool __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -416,13 +416,13 @@ basic_ostream<_CharT, _Traits>::operator<<(bool __n)
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -430,10 +430,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(short __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -446,13 +446,13 @@ basic_ostream<_CharT, _Traits>::operator<<(short __n)
static_cast<long>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -460,10 +460,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(unsigned short __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -472,13 +472,13 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned short __n)
if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -486,10 +486,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(int __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -502,13 +502,13 @@ basic_ostream<_CharT, _Traits>::operator<<(int __n)
static_cast<long>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -516,10 +516,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(unsigned int __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -528,13 +528,13 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned int __n)
if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -542,10 +542,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(long __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -554,13 +554,13 @@ basic_ostream<_CharT, _Traits>::operator<<(long __n)
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -568,10 +568,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -580,13 +580,13 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n)
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -594,10 +594,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(long long __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -606,13 +606,13 @@ basic_ostream<_CharT, _Traits>::operator<<(long long __n)
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -620,10 +620,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(unsigned long long __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -632,13 +632,13 @@ basic_ostream<_CharT, _Traits>::operator<<(unsigned long long __n)
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -646,10 +646,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(float __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -658,13 +658,13 @@ basic_ostream<_CharT, _Traits>::operator<<(float __n)
if (__f.put(*this, *this, this->fill(), static_cast<double>(__n)).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -672,10 +672,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(double __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -684,13 +684,13 @@ basic_ostream<_CharT, _Traits>::operator<<(double __n)
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -698,10 +698,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(long double __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -710,13 +710,13 @@ basic_ostream<_CharT, _Traits>::operator<<(long double __n)
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -724,10 +724,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(const void* __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -736,13 +736,13 @@ basic_ostream<_CharT, _Traits>::operator<<(const void* __n)
if (__f.put(*this, *this, this->fill(), __n).failed())
this->setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -751,10 +751,10 @@ _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
__put_character_sequence(basic_ostream<_CharT, _Traits>& __os,
const _CharT* __str, size_t __len)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
@@ -769,13 +769,13 @@ __put_character_sequence(basic_ostream<_CharT, _Traits>& __os,
__os.fill()).failed())
__os.setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __os;
}
@@ -791,10 +791,10 @@ template<class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
@@ -810,13 +810,13 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn)
__os.fill()).failed())
__os.setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __os;
}
@@ -852,10 +852,10 @@ template<class _CharT, class _Traits>
_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
if (__s)
{
@@ -884,13 +884,13 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn)
__os.fill()).failed())
__os.setstate(ios_base::badbit | ios_base::failbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__os.__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return __os;
}
@@ -921,10 +921,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::put(char_type __c)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __s(*this);
if (__s)
{
@@ -934,13 +934,13 @@ basic_ostream<_CharT, _Traits>::put(char_type __c)
if (__o.failed())
this->setstate(ios_base::badbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -948,23 +948,23 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::write(const char_type* __s, streamsize __n)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
sentry __sen(*this);
if (__sen && __n)
{
if (this->rdbuf()->sputn(__s, __n) != __n)
this->setstate(ios_base::badbit);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
@@ -972,10 +972,10 @@ template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::flush()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (this->rdbuf())
{
sentry __s(*this);
@@ -985,13 +985,13 @@ basic_ostream<_CharT, _Traits>::flush()
this->setstate(ios_base::badbit);
}
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
this->__set_badbit_and_consider_rethrow();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return *this;
}
diff --git a/libcxx/include/regex b/libcxx/include/regex
index f8a2dc7ac4557..59c11f72051c7 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -1012,7 +1012,7 @@ template <regex_constants::error_type _Ev>
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_regex_error()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw regex_error(_Ev);
#else
_VSTD::abort();
diff --git a/libcxx/include/sstream b/libcxx/include/sstream
index 78cc28a502824..389bbf6aae1e3 100644
--- a/libcxx/include/sstream
+++ b/libcxx/include/sstream
@@ -541,10 +541,10 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::overflow(int_type __c)
{
if (!(__mode_ & ios_base::out))
return traits_type::eof();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
ptr
diff _t __nout = this->pptr() - this->pbase();
ptr
diff _t __hm = __hm_ - this->pbase();
__str_.push_back(char_type());
@@ -553,13 +553,13 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::overflow(int_type __c)
this->setp(__p, __p + __str_.size());
this->__pbump(__nout);
__hm_ = this->pbase() + __hm;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
return traits_type::eof();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
__hm_ = _VSTD::max(this->pptr() + 1, __hm_);
if (__mode_ & ios_base::in)
diff --git a/libcxx/include/stdexcept b/libcxx/include/stdexcept
index 68de6ced174a7..6b7d10b5dc799 100644
--- a/libcxx/include/stdexcept
+++ b/libcxx/include/stdexcept
@@ -220,7 +220,7 @@ _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*);
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_logic_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw logic_error(__msg);
#else
((void)__msg);
@@ -231,7 +231,7 @@ void __throw_logic_error(const char*__msg)
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_domain_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw domain_error(__msg);
#else
((void)__msg);
@@ -242,7 +242,7 @@ void __throw_domain_error(const char*__msg)
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_invalid_argument(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw invalid_argument(__msg);
#else
((void)__msg);
@@ -253,7 +253,7 @@ void __throw_invalid_argument(const char*__msg)
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_length_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw length_error(__msg);
#else
((void)__msg);
@@ -264,7 +264,7 @@ void __throw_length_error(const char*__msg)
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_out_of_range(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw out_of_range(__msg);
#else
((void)__msg);
@@ -275,7 +275,7 @@ void __throw_out_of_range(const char*__msg)
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_range_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw range_error(__msg);
#else
((void)__msg);
@@ -286,7 +286,7 @@ void __throw_range_error(const char*__msg)
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_overflow_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw overflow_error(__msg);
#else
((void)__msg);
@@ -297,7 +297,7 @@ void __throw_overflow_error(const char*__msg)
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_underflow_error(const char*__msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw underflow_error(__msg);
#else
((void)__msg);
diff --git a/libcxx/include/string b/libcxx/include/string
index a2878df76f9e1..ede917f3431ed 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -2288,13 +2288,13 @@ __enable_if_t
basic_string<_CharT, _Traits, _Allocator>::__init(_InputIterator __first, _InputIterator __last)
{
__default_init();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __first != __last; ++__first)
push_back(*__first);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -2302,7 +2302,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init(_InputIterator __first, _Input
__alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _CharT, class _Traits, class _Allocator>
@@ -2335,14 +2335,14 @@ basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator __first, _For
__set_long_size(__sz);
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __first != __last; ++__first, (void) ++__p)
traits_type::assign(*__p, *__first);
traits_type::assign(*__p, value_type());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -2350,7 +2350,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator __first, _For
__alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _CharT, class _Traits, class _Allocator>
@@ -3365,23 +3365,23 @@ basic_string<_CharT, _Traits, _Allocator>::__shrink_or_extend(size_type __target
}
else
{
- #ifndef _LIBCPP_NO_EXCEPTIONS
+ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
- #endif // _LIBCPP_NO_EXCEPTIONS
+ #endif // _LIBCPP_HAS_NO_EXCEPTIONS
auto __allocation = std::__allocate_at_least(__alloc(), __target_capacity + 1);
__new_data = __allocation.ptr;
__target_capacity = __allocation.count - 1;
- #ifndef _LIBCPP_NO_EXCEPTIONS
+ #ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
return;
}
- #else // _LIBCPP_NO_EXCEPTIONS
+ #else // _LIBCPP_HAS_NO_EXCEPTIONS
if (__new_data == nullptr)
return;
- #endif // _LIBCPP_NO_EXCEPTIONS
+ #endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
__begin_lifetime(__new_data, __target_capacity + 1);
__now_long = true;
diff --git a/libcxx/include/typeinfo b/libcxx/include/typeinfo
index 5627da16cbc0c..b3ba8c2c5600a 100644
--- a/libcxx/include/typeinfo
+++ b/libcxx/include/typeinfo
@@ -406,7 +406,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
void __throw_bad_cast()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_cast();
#else
_VSTD::abort();
diff --git a/libcxx/include/valarray b/libcxx/include/valarray
index 28b236975f994..a52fc1088e467 100644
--- a/libcxx/include/valarray
+++ b/libcxx/include/valarray
@@ -2818,20 +2818,20 @@ valarray<_Tp>::valarray(size_t __n)
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)
::new ((void*)__end_) value_type();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2852,20 +2852,20 @@ valarray<_Tp>::valarray(const value_type* __p, size_t __n)
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (size_t __n_left = __n; __n_left; ++__end_, ++__p, --__n_left)
::new ((void*)__end_) value_type(*__p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2877,20 +2877,20 @@ valarray<_Tp>::valarray(const valarray& __v)
if (__v.size())
{
__begin_ = __end_ = allocator<value_type>().allocate(__v.size());
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (value_type* __p = __v.__begin_; __p != __v.__end_; ++__end_, ++__p)
::new ((void*)__end_) value_type(*__p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__v.size());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2914,21 +2914,21 @@ valarray<_Tp>::valarray(initializer_list<value_type> __il)
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
size_t __n_left = __n;
for (const value_type* __p = __il.begin(); __n_left; ++__end_, ++__p, --__n_left)
::new ((void*)__end_) value_type(*__p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2943,21 +2943,21 @@ valarray<_Tp>::valarray(const slice_array<value_type>& __sa)
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
size_t __n_left = __n;
for (const value_type* __p = __sa.__vp_; __n_left; ++__end_, __p += __sa.__stride_, --__n_left)
::new ((void*)__end_) value_type(*__p);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2970,23 +2970,23 @@ valarray<_Tp>::valarray(const gslice_array<value_type>& __ga)
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef const size_t* _Ip;
const value_type* __s = __ga.__vp_;
for (_Ip __i = __ga.__1d_.__begin_, __e = __ga.__1d_.__end_;
__i != __e; ++__i, ++__end_)
::new ((void*)__end_) value_type(__s[*__i]);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -2999,23 +2999,23 @@ valarray<_Tp>::valarray(const mask_array<value_type>& __ma)
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef const size_t* _Ip;
const value_type* __s = __ma.__vp_;
for (_Ip __i = __ma.__1d_.__begin_, __e = __ma.__1d_.__end_;
__i != __e; ++__i, ++__end_)
::new ((void*)__end_) value_type(__s[*__i]);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -3028,23 +3028,23 @@ valarray<_Tp>::valarray(const indirect_array<value_type>& __ia)
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
typedef const size_t* _Ip;
const value_type* __s = __ia.__vp_;
for (_Ip __i = __ia.__1d_.__begin_, __e = __ia.__1d_.__end_;
__i != __e; ++__i, ++__end_)
::new ((void*)__end_) value_type(__s[*__i]);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -3753,20 +3753,20 @@ valarray<_Tp>::resize(size_t __n, value_type __x)
if (__n)
{
__begin_ = __end_ = allocator<value_type>().allocate(__n);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)
::new ((void*)__end_) value_type(__x);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
__clear(__n);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
diff --git a/libcxx/include/variant b/libcxx/include/variant
index f03ce91d42891..c5234692b4a38 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -285,7 +285,7 @@ _LIBCPP_NORETURN
inline _LIBCPP_HIDE_FROM_ABI
_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
void __throw_bad_variant_access() {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_variant_access();
#else
_VSTD::abort();
@@ -1187,7 +1187,7 @@ public:
_VSTD::swap(__lhs, __rhs);
}
__impl __tmp(_VSTD::move(*__rhs));
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
if constexpr (__all<is_nothrow_move_constructible_v<_Types>...>::value) {
this->__generic_construct(*__rhs, _VSTD::move(*__lhs));
} else {
diff --git a/libcxx/include/vector b/libcxx/include/vector
index c4235b4387f11..619e25822a462 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -1512,19 +1512,19 @@ vector<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
{
if (capacity() > size())
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
allocator_type& __a = this->__alloc();
__split_buffer<value_type, allocator_type&> __v(size(), size(), __a);
__swap_out_circular_buffer(__v);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -1831,24 +1831,24 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __firs
__split_buffer<value_type, allocator_type&> __v(__a);
if (__first != __last)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__v.__construct_at_end(__first, __last);
diff erence_type __old_size = __old_last - this->__begin_;
diff erence_type __old_p = __p - this->__begin_;
reserve(__recommend(size() + __v.size()));
__p = this->__begin_ + __old_p;
__old_last = this->__begin_ + __old_size;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
erase(__make_iter(__old_last), end());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
__p = std::rotate(__p, __old_last, this->__end_);
insert(__make_iter(__p), std::make_move_iterator(__v.begin()),
@@ -2603,13 +2603,13 @@ vector<bool, _Allocator>::vector(_InputIterator __first, _InputIterator __last,
__size_(0),
__cap_alloc_(0, __default_init_tag())
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __first != __last; ++__first)
push_back(*__first);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -2618,7 +2618,7 @@ vector<bool, _Allocator>::vector(_InputIterator __first, _InputIterator __last,
std::__debug_db_invalidate_all(this);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _Allocator>
@@ -2630,13 +2630,13 @@ vector<bool, _Allocator>::vector(_InputIterator __first, _InputIterator __last,
__size_(0),
__cap_alloc_(0, static_cast<__storage_allocator>(__a))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
for (; __first != __last; ++__first)
push_back(*__first);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -2645,7 +2645,7 @@ vector<bool, _Allocator>::vector(_InputIterator __first, _InputIterator __last,
std::__debug_db_invalidate_all(this);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template <class _Allocator>
@@ -2923,17 +2923,17 @@ vector<bool, _Allocator>::shrink_to_fit() _NOEXCEPT
{
if (__external_cap_to_internal(size()) > __cap())
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
vector(*this, allocator_type(__alloc())).swap(*this);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
}
@@ -3034,24 +3034,24 @@ vector<bool, _Allocator>::insert(const_iterator __position, _InputIterator __fir
vector __v(get_allocator());
if (__first != __last)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__v.assign(__first, __last);
diff erence_type __old_size = static_cast<
diff erence_type>(__old_end - begin());
diff erence_type __old_p = __p - begin();
reserve(__recommend(size() + __v.size()));
__p = begin() + __old_p;
__old_end = begin() + __old_size;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
erase(__old_end, end());
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
__p = std::rotate(__p, __old_end, end());
insert(__p, __v.begin(), __v.end());
diff --git a/libcxx/src/filesystem/filesystem_common.h b/libcxx/src/filesystem/filesystem_common.h
index 0e71569d87122..fb6f88783cd03 100644
--- a/libcxx/src/filesystem/filesystem_common.h
+++ b/libcxx/src/filesystem/filesystem_common.h
@@ -96,16 +96,16 @@ format_string(const char* msg, ...) {
string ret;
va_list ap;
va_start(ap, msg);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
ret = format_string_impl(msg, ap);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
va_end(ap);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
va_end(ap);
return ret;
}
@@ -202,16 +202,16 @@ struct ErrorHandler {
T report(const error_code& ec, const char* msg, ...) const {
va_list ap;
va_start(ap, msg);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
report_impl(ec, msg, ap);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
va_end(ap);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
va_end(ap);
return error_value<T>();
}
@@ -224,16 +224,16 @@ struct ErrorHandler {
T report(errc const& err, const char* msg, ...) const {
va_list ap;
va_start(ap, msg);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try {
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
report_impl(make_error_code(err), msg, ap);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
} catch (...) {
va_end(ap);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
va_end(ap);
return error_value<T>();
}
diff --git a/libcxx/src/future.cpp b/libcxx/src/future.cpp
index cdaa93827533d..f8f466bd5a21c 100644
--- a/libcxx/src/future.cpp
+++ b/libcxx/src/future.cpp
@@ -197,12 +197,12 @@ promise<void>::~promise()
{
if (__state_)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
if (!__state_->__has_value() && __state_->use_count() > 1)
__state_->set_exception(make_exception_ptr(
future_error(make_error_code(future_errc::broken_promise))
));
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__state_->__release_shared();
}
}
diff --git a/libcxx/src/ios.cpp b/libcxx/src/ios.cpp
index 870406b554d98..bb62eb9948758 100644
--- a/libcxx/src/ios.cpp
+++ b/libcxx/src/ios.cpp
@@ -413,20 +413,20 @@ void
ios_base::__set_badbit_and_consider_rethrow()
{
__rdstate_ |= badbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
if (__exceptions_ & badbit)
throw;
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
void
ios_base::__set_failbit_and_consider_rethrow()
{
__rdstate_ |= failbit;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
if (__exceptions_ & failbit)
throw;
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
bool
diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index 678c4877ef8b4..1e60c025b127a 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -118,7 +118,7 @@ countof(const T * const begin, const T * const end)
_LIBCPP_NORETURN static void __throw_runtime_error(const string &msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw runtime_error(msg);
#else
(void)msg;
@@ -236,10 +236,10 @@ locale::__imp::__imp(const string& name, size_t refs)
facets_(N),
name_(name)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
facets_ = locale::classic().__locale_->facets_;
for (unsigned i = 0; i < facets_.size(); ++i)
if (facets_[i])
@@ -286,7 +286,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
install(new messages_byname<wchar_t>(name_));
#endif
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -295,7 +295,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
facets_[i]->__release_shared();
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
locale::__imp::__imp(const __imp& other)
@@ -316,10 +316,10 @@ locale::__imp::__imp(const __imp& other, const string& name, locale::category c)
for (unsigned i = 0; i < facets_.size(); ++i)
if (facets_[i])
facets_[i]->__add_shared();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (c & locale::collate)
{
install(new collate_byname<char>(name));
@@ -380,7 +380,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
install(new messages_byname<wchar_t>(name));
#endif
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -389,7 +389,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
facets_[i]->__release_shared();
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
template<class F>
@@ -409,10 +409,10 @@ locale::__imp::__imp(const __imp& other, const __imp& one, locale::category c)
for (unsigned i = 0; i < facets_.size(); ++i)
if (facets_[i])
facets_[i]->__add_shared();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
if (c & locale::collate)
{
install_from<_VSTD::collate<char> >(one);
@@ -489,7 +489,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
install_from<_VSTD::messages<wchar_t> >(one);
#endif
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -498,7 +498,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
facets_[i]->__release_shared();
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
locale::__imp::__imp(const __imp& other, facet* f, long id)
@@ -6529,7 +6529,7 @@ void __do_nothing(void*) {}
void __throw_runtime_error(const char* msg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw runtime_error(msg);
#else
(void)msg;
diff --git a/libcxx/src/mutex.cpp b/libcxx/src/mutex.cpp
index 01b7420fa3b8a..c09c064fdbac6 100644
--- a/libcxx/src/mutex.cpp
+++ b/libcxx/src/mutex.cpp
@@ -211,21 +211,21 @@ void __call_once(volatile once_flag::_State_type& flag, void* arg,
#if defined(_LIBCPP_HAS_NO_THREADS)
if (flag == 0)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
flag = 1;
func(arg);
flag = ~once_flag::_State_type(0);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
flag = 0;
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
#else // !_LIBCPP_HAS_NO_THREADS
__libcpp_mutex_lock(&mut);
@@ -233,10 +233,10 @@ void __call_once(volatile once_flag::_State_type& flag, void* arg,
__libcpp_condvar_wait(&cv, &mut);
if (flag == 0)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
__libcpp_relaxed_store(&flag, once_flag::_State_type(1));
__libcpp_mutex_unlock(&mut);
func(arg);
@@ -245,7 +245,7 @@ void __call_once(volatile once_flag::_State_type& flag, void* arg,
_AO_Release);
__libcpp_mutex_unlock(&mut);
__libcpp_condvar_broadcast(&cv);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -255,7 +255,7 @@ void __call_once(volatile once_flag::_State_type& flag, void* arg,
__libcpp_condvar_broadcast(&cv);
throw;
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
else
__libcpp_mutex_unlock(&mut);
diff --git a/libcxx/src/new.cpp b/libcxx/src/new.cpp
index f2ca698512ff4..3c3d1dc7f56b6 100644
--- a/libcxx/src/new.cpp
+++ b/libcxx/src/new.cpp
@@ -39,7 +39,7 @@ const nothrow_t nothrow{};
void
__throw_bad_alloc()
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw bad_alloc();
#else
_VSTD::abort();
@@ -73,7 +73,7 @@ operator new(std::size_t size) _THROW_BAD_ALLOC
if (nh)
nh();
else
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw std::bad_alloc();
#else
break;
@@ -87,17 +87,17 @@ void*
operator new(size_t size, const std::nothrow_t&) noexcept
{
void* p = nullptr;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
p = ::operator new(size);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return p;
}
@@ -113,17 +113,17 @@ void*
operator new[](size_t size, const std::nothrow_t&) noexcept
{
void* p = nullptr;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
p = ::operator new[](size);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return p;
}
@@ -193,7 +193,7 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
if (nh)
nh();
else {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw std::bad_alloc();
#else
break;
@@ -208,17 +208,17 @@ void*
operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept
{
void* p = nullptr;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
p = ::operator new(size, alignment);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return p;
}
@@ -234,17 +234,17 @@ void*
operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept
{
void* p = nullptr;
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
p = ::operator new[](size, alignment);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
return p;
}
diff --git a/libcxx/src/string.cpp b/libcxx/src/string.cpp
index db211b2242776..b18dcceb37c0d 100644
--- a/libcxx/src/string.cpp
+++ b/libcxx/src/string.cpp
@@ -63,7 +63,7 @@ namespace
template<typename T>
inline void throw_helper(const string& msg) {
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw T(msg);
#else
fprintf(stderr, "%s\n", msg.c_str());
diff --git a/libcxx/src/support/runtime/exception_fallback.ipp b/libcxx/src/support/runtime/exception_fallback.ipp
index ade933567f236..3b2716d36f0e6 100644
--- a/libcxx/src/support/runtime/exception_fallback.ipp
+++ b/libcxx/src/support/runtime/exception_fallback.ipp
@@ -51,15 +51,15 @@ _LIBCPP_NORETURN
void
terminate() noexcept
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
(*get_terminate())();
// handler should not return
fprintf(stderr, "terminate_handler unexpectedly returned\n");
::abort();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -67,7 +67,7 @@ terminate() noexcept
fprintf(stderr, "terminate_handler unexpectedly threw an exception\n");
::abort();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; }
diff --git a/libcxx/src/support/runtime/exception_msvc.ipp b/libcxx/src/support/runtime/exception_msvc.ipp
index 7e36c7068a28e..0114d5adee167 100644
--- a/libcxx/src/support/runtime/exception_msvc.ipp
+++ b/libcxx/src/support/runtime/exception_msvc.ipp
@@ -57,15 +57,15 @@ terminate_handler get_terminate() noexcept {
_LIBCPP_NORETURN
void terminate() noexcept
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try
{
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
(*get_terminate())();
// handler should not return
fprintf(stderr, "terminate_handler unexpectedly returned\n");
::abort();
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
}
catch (...)
{
@@ -73,7 +73,7 @@ void terminate() noexcept
fprintf(stderr, "terminate_handler unexpectedly threw an exception\n");
::abort();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#endif // _LIBCPP_HAS_NO_EXCEPTIONS
}
bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; }
diff --git a/libcxx/src/system_error.cpp b/libcxx/src/system_error.cpp
index ba5fa8f30b283..190abfd703ab2 100644
--- a/libcxx/src/system_error.cpp
+++ b/libcxx/src/system_error.cpp
@@ -286,7 +286,7 @@ system_error::~system_error() noexcept
void
__throw_system_error(int ev, const char* what_arg)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
+#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw system_error(error_code(ev, system_category()), what_arg);
#else
(void)ev;
More information about the libcxx-commits
mailing list