From c8afd97b47690d60e0e4df203873bd27c10840f5 Mon Sep 17 00:00:00 2001 From: Boris Gubenko Date: Mon, 11 Jun 2007 15:14:49 +0000 Subject: [PATCH] strerror vs strerror_r: add conditionalization for Tru64 and VMS [SVN r37966] --- src/error_code.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/error_code.cpp b/src/error_code.cpp index b28f49a..616a22e 100644 --- a/src/error_code.cpp +++ b/src/error_code.cpp @@ -191,8 +191,13 @@ namespace // no way to tell if is available at runtime and in any case their // versions of strerror are thread safe anyhow. // -- Linux only sometimes provides strerror_r. + // -- Tru64 provides strerror_r only when compiled -pthread. + // -- VMS doesn't provide strerror_r, but on this platform, strerror is + // thread safe. # if defined(BOOST_WINDOWS_API) || defined(__hpux) || defined(__sun)\ - || (defined(__linux) && (!defined(__USE_XOPEN2K) || defined(BOOST_SYSTEM_USE_STRERROR))) + || (defined(__linux) && (!defined(__USE_XOPEN2K) || defined(BOOST_SYSTEM_USE_STRERROR)))\ + || (defined(__osf__) && !defined(_REENTRANT))\ + || (defined(__vms)) const char * c_str = std::strerror( ec.value() ); return std::string( c_str ? c_str : "EINVAL" ); # else