Merge branch 'master' of git://factorcode.org/git/factor

db4
Doug Coleman 2008-04-11 21:55:58 -05:00
commit 77d9dc06a6
1 changed files with 7 additions and 7 deletions

View File

@ -3,7 +3,7 @@ continuations destructors io io.backend io.nonblocking
io.windows libc kernel math namespaces sequences io.windows libc kernel math namespaces sequences
threads classes.tuple.lib windows windows.errors threads classes.tuple.lib windows windows.errors
windows.kernel32 strings splitting io.files qualified ascii windows.kernel32 strings splitting io.files qualified ascii
combinators.lib system ; combinators.lib system accessors ;
QUALIFIED: windows.winsock QUALIFIED: windows.winsock
IN: io.windows.nt.backend IN: io.windows.nt.backend
@ -38,7 +38,7 @@ M: winnt add-completion ( handle -- )
zero? [ zero? [
GetLastError { GetLastError {
{ [ dup expected-io-error? ] [ 2drop t ] } { [ dup expected-io-error? ] [ 2drop t ] }
{ [ dup eof? ] [ drop t swap set-port-eof? f ] } { [ dup eof? ] [ drop t >>eof drop f ] }
[ (win32-error-string) throw ] [ (win32-error-string) throw ]
} cond } cond
] [ ] [
@ -46,7 +46,7 @@ M: winnt add-completion ( handle -- )
] if ; ] if ;
: get-overlapped-result ( overlapped port -- bytes-transferred ) : get-overlapped-result ( overlapped port -- bytes-transferred )
dup port-handle win32-file-handle rot 0 <uint> dup handle>> handle>> rot 0 <uint>
[ 0 GetOverlappedResult overlapped-error? drop ] keep *uint ; [ 0 GetOverlappedResult overlapped-error? drop ] keep *uint ;
: save-callback ( overlapped port -- ) : save-callback ( overlapped port -- )
@ -75,11 +75,11 @@ M: winnt add-completion ( handle -- )
] [ ] [
dup eof? [ dup eof? [
drop lookup-callback drop lookup-callback
dup io-callback-port t swap set-port-eof? dup port>> t >>eof drop
] [ ] [
(win32-error-string) swap lookup-callback (win32-error-string) swap lookup-callback
[ io-callback-port set-port-error ] keep [ port>> set-port-error ] keep
] if io-callback-thread resume f ] if thread>> resume f
] if ] if
] [ ] [
lookup-callback lookup-callback
@ -90,7 +90,7 @@ M: winnt add-completion ( handle -- )
handle-overlapped [ 0 drain-overlapped ] unless ; handle-overlapped [ 0 drain-overlapped ] unless ;
M: winnt cancel-io M: winnt cancel-io
port-handle win32-file-handle CancelIo drop ; handle>> handle>> CancelIo drop ;
M: winnt io-multiplex ( ms -- ) M: winnt io-multiplex ( ms -- )
drain-overlapped ; drain-overlapped ;