diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -221,7 +221,12 @@ #endif #if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME) -# define _LIBCPP_ABI_VCRUNTIME +# define _LIBCPP_ABI_VCRUNTIME +# if defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS == 0 +# define _LIBCPP_NO_EXCEPTIONS +# else +# define _LIBCPP_ABI_VCRUNTIME_EXCEPTION +# endif #endif // Need to detect which libc we're using if we're on Linux. diff --git a/libcxx/include/exception b/libcxx/include/exception --- a/libcxx/include/exception +++ b/libcxx/include/exception @@ -84,7 +84,7 @@ #include #include -#if defined(_LIBCPP_ABI_VCRUNTIME) +#if defined(_LIBCPP_ABI_VCRUNTIME_EXCEPTION) #include #endif @@ -95,7 +95,7 @@ namespace std // purposefully not using versioning namespace { -#if !defined(_LIBCPP_ABI_VCRUNTIME) +#if !defined(_LIBCPP_ABI_VCRUNTIME_EXCEPTION) class _LIBCPP_EXCEPTION_ABI exception { public: diff --git a/libcxx/include/stdexcept b/libcxx/include/stdexcept --- a/libcxx/include/stdexcept +++ b/libcxx/include/stdexcept @@ -52,7 +52,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#ifndef _LIBCPP_ABI_VCRUNTIME +#ifndef _LIBCPP_ABI_VCRUNTIME_EXCEPTION class _LIBCPP_HIDDEN __libcpp_refstring { const char* __imp_; @@ -76,7 +76,7 @@ class _LIBCPP_EXCEPTION_ABI logic_error : public exception { -#ifndef _LIBCPP_ABI_VCRUNTIME +#ifndef _LIBCPP_ABI_VCRUNTIME_EXCEPTION private: _VSTD::__libcpp_refstring __imp_; public: @@ -99,7 +99,7 @@ class _LIBCPP_EXCEPTION_ABI runtime_error : public exception { -#ifndef _LIBCPP_ABI_VCRUNTIME +#ifndef _LIBCPP_ABI_VCRUNTIME_EXCEPTION private: _VSTD::__libcpp_refstring __imp_; public: @@ -126,7 +126,7 @@ _LIBCPP_INLINE_VISIBILITY explicit domain_error(const string& __s) : logic_error(__s) {} _LIBCPP_INLINE_VISIBILITY explicit domain_error(const char* __s) : logic_error(__s) {} -#ifndef _LIBCPP_ABI_VCRUNTIME +#ifndef _LIBCPP_ABI_VCRUNTIME_EXCEPTION domain_error(const domain_error&) _NOEXCEPT = default; virtual ~domain_error() _NOEXCEPT; #endif @@ -139,7 +139,7 @@ _LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const string& __s) : logic_error(__s) {} _LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const char* __s) : logic_error(__s) {} -#ifndef _LIBCPP_ABI_VCRUNTIME +#ifndef _LIBCPP_ABI_VCRUNTIME_EXCEPTION invalid_argument(const invalid_argument&) _NOEXCEPT = default; virtual ~invalid_argument() _NOEXCEPT; #endif @@ -151,7 +151,7 @@ public: _LIBCPP_INLINE_VISIBILITY explicit length_error(const string& __s) : logic_error(__s) {} _LIBCPP_INLINE_VISIBILITY explicit length_error(const char* __s) : logic_error(__s) {} -#ifndef _LIBCPP_ABI_VCRUNTIME +#ifndef _LIBCPP_ABI_VCRUNTIME_EXCEPTION length_error(const length_error&) _NOEXCEPT = default; virtual ~length_error() _NOEXCEPT; #endif @@ -164,7 +164,7 @@ _LIBCPP_INLINE_VISIBILITY explicit out_of_range(const string& __s) : logic_error(__s) {} _LIBCPP_INLINE_VISIBILITY explicit out_of_range(const char* __s) : logic_error(__s) {} -#ifndef _LIBCPP_ABI_VCRUNTIME +#ifndef _LIBCPP_ABI_VCRUNTIME_EXCEPTION out_of_range(const out_of_range&) _NOEXCEPT = default; virtual ~out_of_range() _NOEXCEPT; #endif @@ -177,7 +177,7 @@ _LIBCPP_INLINE_VISIBILITY explicit range_error(const string& __s) : runtime_error(__s) {} _LIBCPP_INLINE_VISIBILITY explicit range_error(const char* __s) : runtime_error(__s) {} -#ifndef _LIBCPP_ABI_VCRUNTIME +#ifndef _LIBCPP_ABI_VCRUNTIME_EXCEPTION range_error(const range_error&) _NOEXCEPT = default; virtual ~range_error() _NOEXCEPT; #endif @@ -190,7 +190,7 @@ _LIBCPP_INLINE_VISIBILITY explicit overflow_error(const string& __s) : runtime_error(__s) {} _LIBCPP_INLINE_VISIBILITY explicit overflow_error(const char* __s) : runtime_error(__s) {} -#ifndef _LIBCPP_ABI_VCRUNTIME +#ifndef _LIBCPP_ABI_VCRUNTIME_EXCEPTION overflow_error(const overflow_error&) _NOEXCEPT = default; virtual ~overflow_error() _NOEXCEPT; #endif @@ -203,7 +203,7 @@ _LIBCPP_INLINE_VISIBILITY explicit underflow_error(const string& __s) : runtime_error(__s) {} _LIBCPP_INLINE_VISIBILITY explicit underflow_error(const char* __s) : runtime_error(__s) {} -#ifndef _LIBCPP_ABI_VCRUNTIME +#ifndef _LIBCPP_ABI_VCRUNTIME_EXCEPTION underflow_error(const underflow_error&) _NOEXCEPT = default; virtual ~underflow_error() _NOEXCEPT; #endif