15 #include "llvm/Config/config.h"
35 #endif // HAVE_ERRNO_H
38 const int MaxErrStrLen = 2000;
39 char buffer[MaxErrStrLen];
45 #ifdef HAVE_STRERROR_R
47 #if defined(__GLIBC__) && defined(_GNU_SOURCE)
50 str = strerror_r(errnum, buffer, MaxErrStrLen - 1);
52 strerror_r(errnum, buffer, MaxErrStrLen - 1);
55 #elif HAVE_DECL_STRERROR_S // "Windows Secure API"
56 strerror_s(buffer, MaxErrStrLen - 1, errnum);
58 #elif defined(HAVE_STRERROR)
62 str = strerror(errnum);
67 stream <<
"Error #" << errnum;