Minor cleanup. No functional changes intended.
[oota-llvm.git] / lib / System / Errno.cpp
index f4e3a88d054eaeeec6552652450ecbec71aceb8f..68f66f6e439bd6f36126780594d8a21b50d33d1c 100644 (file)
 #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.
@@ -26,7 +30,6 @@ namespace llvm {
 namespace sys {
 
 #if HAVE_ERRNO_H
-#include <errno.h>
 std::string StrError() {
   return StrError(errno);
 }
@@ -47,10 +50,10 @@ std::string StrError(int errnum) {
 # 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.