USING: alien.c-types kernel locals math math.bitwise
windows.kernel32 sequences byte-arrays unicode.categories
-io.encodings.string io.encodings.utf16n alien.strings ;
+io.encodings.string io.encodings.utf16n alien.strings
+arrays literals ;
IN: windows.errors
CONSTANT: ERROR_SUCCESS 0
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) ;
] when ;
CONSTANT: expected-io-errors
- {
+ ${
ERROR_SUCCESS
ERROR_IO_INCOMPLETE
ERROR_IO_PENDING