It already is. When the macro is defined the old definition is enabled, and only ABI v1 defines the macro.
On Mon, Jan 2, 2017 at 3:41 PM, Saleem Abdulrasool <compn...@compnerd.org> wrote: > Do we want to enable this by default on other targets under > `LIBCXX_ABI_UNSTABLE` as well? > > On Mon, Jan 2, 2017 at 2:17 PM, Eric Fiselier via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> Author: ericwf >> Date: Mon Jan 2 16:17:51 2017 >> New Revision: 290840 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=290840&view=rev >> Log: >> Introduce _LIBCPP_DEPRECATED_ABI_EXTERNAL_ERROR_CATEGORY_CONSTRUCTOR ABI >> option. >> >> Currently libc++ compiles a special version of error_category() >> into the dylib. This definition is no longer needed, and doesn't >> work on Windows due to dllimport/dllexport semantics. >> >> For those reasons this patch introduces an option to >> disable/enable this definition. By default the definition >> is provided in ABI v1 except on windows. This patch >> also addresses D28210. >> >> Modified: >> libcxx/trunk/include/__config >> libcxx/trunk/include/system_error >> libcxx/trunk/src/system_error.cpp >> >> Modified: libcxx/trunk/include/__config >> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__ >> config?rev=290840&r1=290839&r2=290840&view=diff >> ============================================================ >> ================== >> --- libcxx/trunk/include/__config (original) >> +++ libcxx/trunk/include/__config Mon Jan 2 16:17:51 2017 >> @@ -53,6 +53,10 @@ >> // of nullptr_t. This option is ABI incompatible with GCC in C++03 mode. >> #define _LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR >> #elif _LIBCPP_ABI_VERSION == 1 >> +#if !defined(_WIN32) >> +// Enable compiling a definition of error_category() into the libc++ >> dylib. >> +#define _LIBCPP_DEPRECATED_ABI_EXTERNAL_ERROR_CATEGORY_CONSTRUCTOR >> +#endif >> // Feature macros for disabling pre ABI v1 features. All of these options >> // are deprecated. >> #if defined(__FreeBSD__) >> >> Modified: libcxx/trunk/include/system_error >> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/sys >> tem_error?rev=290840&r1=290839&r2=290840&view=diff >> ============================================================ >> ================== >> --- libcxx/trunk/include/system_error (original) >> +++ libcxx/trunk/include/system_error Mon Jan 2 16:17:51 2017 >> @@ -384,7 +384,8 @@ class _LIBCPP_TYPE_VIS error_category >> public: >> virtual ~error_category() _NOEXCEPT; >> >> -#ifdef _LIBCPP_BUILDING_SYSTEM_ERROR >> +#if defined(_LIBCPP_BUILDING_SYSTEM_ERROR) && \ >> + defined(_LIBCPP_DEPRECATED_ABI_EXTERNAL_ERROR_CATEGORY_CONSTRUCTOR) >> error_category() _NOEXCEPT; >> #else >> _LIBCPP_ALWAYS_INLINE >> >> Modified: libcxx/trunk/src/system_error.cpp >> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/system_ >> error.cpp?rev=290840&r1=290839&r2=290840&view=diff >> ============================================================ >> ================== >> --- libcxx/trunk/src/system_error.cpp (original) >> +++ libcxx/trunk/src/system_error.cpp Mon Jan 2 16:17:51 2017 >> @@ -29,9 +29,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD >> >> // class error_category >> >> +#if defined(_LIBCPP_DEPRECATED_ABI_EXTERNAL_ERROR_CATEGORY_CONSTRUCTOR) >> error_category::error_category() _NOEXCEPT >> { >> } >> +#endif >> >> error_category::~error_category() _NOEXCEPT >> { >> >> >> _______________________________________________ >> cfe-commits mailing list >> cfe-commits@lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits >> > > > > -- > Saleem Abdulrasool > compnerd (at) compnerd (dot) org >
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits