#if HAVE_STRING_H
#include <string.h>
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
//===----------------------------------------------------------------------===//
//=== WARNING: Implementation here must contain only TRULY operating system
//=== independent code.
namespace sys {
#if HAVE_ERRNO_H
-#include <errno.h>
std::string StrError() {
return StrError(errno);
}
# else
strerror_r(errnum,buffer,MaxErrStrLen-1);
# endif
-#elif HAVE_STRERROR_S // Windows.
+#elif defined(HAVE_STRERROR_S) // Windows.
if (errnum)
strerror_s(buffer, errnum);
-#elif HAVE_STRERROR
+#elif defined(HAVE_STRERROR)
// Copy the thread un-safe result of strerror into
// the buffer as fast as possible to minimize impact
// of collision of strerror in multiple threads.