Fix system error message decoding on Windows.
[sbcl.git] / src / code / misc-aliens.lisp
index bf11807..f3a55c3 100644 (file)
       "Return the value of the C library pseudo-variable named \"errno\".")
 
 ;;; Decode errno into a string.
+#!-win32
 (defun strerror (&optional (errno (get-errno)))
   (alien-funcall (extern-alien "strerror" (function c-string int)) errno))
+
+#!+win32
+(defun strerror (&optional (errno (sb!win32:get-last-error)))
+  (sb!win32:format-system-message errno))