15 #include "llvm/Config/config.h"
35 #endif // HAVE_ERRNO_H
41 #if defined(HAVE_STRERROR_R) || HAVE_DECL_STRERROR_S
42 const int MaxErrStrLen = 2000;
43 char buffer[MaxErrStrLen];
47 #ifdef HAVE_STRERROR_R
49 #if defined(__GLIBC__) && defined(_GNU_SOURCE)
52 str = strerror_r(errnum, buffer, MaxErrStrLen - 1);
54 strerror_r(errnum, buffer, MaxErrStrLen - 1);
57 #elif HAVE_DECL_STRERROR_S // "Windows Secure API"
58 strerror_s(buffer, MaxErrStrLen - 1, errnum);
60 #elif defined(HAVE_STRERROR)
64 str = strerror(errnum);
69 stream <<
"Error #" << errnum;
std::string StrError()
Returns a string representation of the errno value, using whatever thread-safe variant of strerror() ...
A raw_ostream that writes to an std::string.