<div dir="ltr">It already is. When the macro is defined the old definition is enabled, and only ABI v1 defines the macro.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 2, 2017 at 3:41 PM, Saleem Abdulrasool <span dir="ltr"><<a href="mailto:compnerd@compnerd.org" target="_blank">compnerd@compnerd.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Do we want to enable this by default on other targets under `LIBCXX_ABI_UNSTABLE` as well?</div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Mon, Jan 2, 2017 at 2:17 PM, Eric Fiselier via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ericwf<br>
Date: Mon Jan  2 16:17:51 2017<br>
New Revision: 290840<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=290840&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=290840&view=rev</a><br>
Log:<br>
Introduce _LIBCPP_DEPRECATED_ABI_EXTERNA<wbr>L_ERROR_CATEGORY_CONSTRUCTOR ABI option.<br>
<br>
Currently libc++ compiles a special version of error_category()<br>
into the dylib. This definition is no longer needed, and doesn't<br>
work on Windows due to dllimport/dllexport semantics.<br>
<br>
For those reasons this patch introduces an option to<br>
disable/enable this definition. By default the definition<br>
is provided in ABI v1 except on windows. This patch<br>
also addresses D28210.<br>
<br>
Modified:<br>
    libcxx/trunk/include/__config<br>
    libcxx/trunk/include/system_er<wbr>ror<br>
    libcxx/trunk/src/system_error.<wbr>cpp<br>
<br>
Modified: libcxx/trunk/include/__config<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=290840&r1=290839&r2=290840&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/libcxx/trunk/include/__<wbr>config?rev=290840&r1=290839&r2<wbr>=290840&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/include/__config (original)<br>
+++ libcxx/trunk/include/__config Mon Jan  2 16:17:51 2017<br>
@@ -53,6 +53,10 @@<br>
 // of nullptr_t. This option is ABI incompatible with GCC in C++03 mode.<br>
 #define _LIBCPP_ABI_ALWAYS_USE_CXX11_N<wbr>ULLPTR<br>
 #elif _LIBCPP_ABI_VERSION == 1<br>
+#if !defined(_WIN32)<br>
+// Enable compiling a definition of error_category() into the libc++ dylib.<br>
+#define _LIBCPP_DEPRECATED_ABI_EXTERNA<wbr>L_ERROR_CATEGORY_CONSTRUCTOR<br>
+#endif<br>
 // Feature macros for disabling pre ABI v1 features. All of these options<br>
 // are deprecated.<br>
 #if defined(__FreeBSD__)<br>
<br>
Modified: libcxx/trunk/include/system_er<wbr>ror<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/system_error?rev=290840&r1=290839&r2=290840&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/libcxx/trunk/include/sys<wbr>tem_error?rev=290840&r1=290839<wbr>&r2=290840&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/include/system_er<wbr>ror (original)<br>
+++ libcxx/trunk/include/system_er<wbr>ror Mon Jan  2 16:17:51 2017<br>
@@ -384,7 +384,8 @@ class _LIBCPP_TYPE_VIS error_category<br>
 public:<br>
     virtual ~error_category() _NOEXCEPT;<br>
<br>
-#ifdef _LIBCPP_BUILDING_SYSTEM_ERROR<br>
+#if defined(_LIBCPP_BUILDING_SYSTE<wbr>M_ERROR) && \<br>
+    defined(_LIBCPP_DEPRECATED_ABI<wbr>_EXTERNAL_ERROR_CATEGORY_CONST<wbr>RUCTOR)<br>
     error_category() _NOEXCEPT;<br>
 #else<br>
     _LIBCPP_ALWAYS_INLINE<br>
<br>
Modified: libcxx/trunk/src/system_error.<wbr>cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/system_error.cpp?rev=290840&r1=290839&r2=290840&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/libcxx/trunk/src/system_<wbr>error.cpp?rev=290840&r1=<wbr>290839&r2=290840&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/src/system_error.<wbr>cpp (original)<br>
+++ libcxx/trunk/src/system_error.<wbr>cpp Mon Jan  2 16:17:51 2017<br>
@@ -29,9 +29,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD<br>
<br>
 // class error_category<br>
<br>
+#if defined(_LIBCPP_DEPRECATED_ABI<wbr>_EXTERNAL_ERROR_CATEGORY_CONST<wbr>RUCTOR)<br>
 error_category::error_categor<wbr>y() _NOEXCEPT<br>
 {<br>
 }<br>
+#endif<br>
<br>
 error_category::~error_catego<wbr>ry() _NOEXCEPT<br>
 {<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_8019030292715264296gmail_signature" data-smartmail="gmail_signature">Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org</div>
</font></span></div>
</blockquote></div><br></div>