]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/windows/errors/errors.factor
Merge branch 'master' of git@github.com:prunedtree/factor
[factor.git] / basis / windows / errors / errors.factor
index e08704d46970102f21a3e48e639834417b1a13ec..8bdbb9f1e99838bbcd812d1afce3966d2f73ce03 100644 (file)
@@ -1,7 +1,7 @@
 USING: alien.c-types kernel locals math math.bitwise
 windows.kernel32 sequences byte-arrays unicode.categories
 io.encodings.string io.encodings.utf16n alien.strings
-arrays ;
+arrays literals ;
 IN: windows.errors
 
 CONSTANT: ERROR_SUCCESS                               0
@@ -713,11 +713,7 @@ ERROR: error-message-failed id ;
     GetLastError n>win32-error-string ;
 
 : (win32-error) ( n -- )
-    dup zero? [
-        drop
-    ] [
-        win32-error-string throw
-    ] if ;
+    [ win32-error-string throw ] unless-zero ;
 
 : win32-error ( -- )
     GetLastError (win32-error) ;
@@ -732,11 +728,13 @@ ERROR: error-message-failed id ;
         win32-error-string throw
     ] when ;
 
-: expected-io-errors ( -- seq )
-    ERROR_SUCCESS
-    ERROR_IO_INCOMPLETE
-    ERROR_IO_PENDING
-    WAIT_TIMEOUT 4array ; foldable
+CONSTANT: expected-io-errors
+    ${
+        ERROR_SUCCESS
+        ERROR_IO_INCOMPLETE
+        ERROR_IO_PENDING
+        WAIT_TIMEOUT
+    }
 
 : expected-io-error? ( error-code -- ? )
     expected-io-errors member? ;