[libcxx] r290791 - system_error: use strerror_r only for threaded code

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 31 13:24:04 PST 2016


Author: compnerd
Date: Sat Dec 31 15:24:04 2016
New Revision: 290791

URL: http://llvm.org/viewvc/llvm-project?rev=290791&view=rev
Log:
system_error: use strerror_r only for threaded code

When building libc++ without threading, strerror_r is not used.  Define
the code only when threading is enabled.  This allows us to build
system_error for Windows, which ATM doesn't build with threading.

Modified:
    libcxx/trunk/src/system_error.cpp

Modified: libcxx/trunk/src/system_error.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/system_error.cpp?rev=290791&r1=290790&r2=290791&view=diff
==============================================================================
--- libcxx/trunk/src/system_error.cpp (original)
+++ libcxx/trunk/src/system_error.cpp Sat Dec 31 15:24:04 2016
@@ -55,6 +55,7 @@ error_category::equivalent(const error_c
     return *this == code.category() && code.value() == condition;
 }
 
+#if !defined(_LIBCPP_HAS_NO_THREADS)
 namespace {
 
 //  GLIBC also uses 1024 as the maximum buffer size internally.
@@ -96,6 +97,7 @@ string do_strerror_r(int ev) {
 #endif
 
 } // end namespace
+#endif
 
 string
 __do_message::message(int ev) const




More information about the cfe-commits mailing list