fix windows bootstrap
							parent
							
								
									87a705e782
								
							
						
					
					
						commit
						b35ef01860
					
				| 
						 | 
					@ -1,11 +1,12 @@
 | 
				
			||||||
! Copyright (C) 2007, 2008 Doug Coleman, Slava Pestov.
 | 
					! Copyright (C) 2007, 2008 Doug Coleman, Slava Pestov.
 | 
				
			||||||
! See http://factorcode.org/license.txt for BSD license.
 | 
					! See http://factorcode.org/license.txt for BSD license.
 | 
				
			||||||
USING: alien alien.c-types arrays continuations destructors io
 | 
					USING: alien alien.c-types arrays continuations io
 | 
				
			||||||
io.windows io.windows.nt.pipes libc io.nonblocking
 | 
					io.windows io.windows.nt.pipes libc io.nonblocking
 | 
				
			||||||
io.streams.duplex windows.types math windows.kernel32 windows
 | 
					io.streams.duplex windows.types math windows.kernel32
 | 
				
			||||||
namespaces io.launcher kernel sequences windows.errors assocs
 | 
					namespaces io.launcher kernel sequences windows.errors
 | 
				
			||||||
splitting system threads init strings combinators
 | 
					splitting system threads init strings combinators
 | 
				
			||||||
io.backend accessors concurrency.flags io.files ;
 | 
					io.backend accessors concurrency.flags io.files assocs
 | 
				
			||||||
 | 
					io.files.private windows destructors ;
 | 
				
			||||||
IN: io.windows.launcher
 | 
					IN: io.windows.launcher
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TUPLE: CreateProcess-args
 | 
					TUPLE: CreateProcess-args
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,7 +32,8 @@ M: windows normalize-directory ( string -- string )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: default-security-attributes ( -- obj )
 | 
					: default-security-attributes ( -- obj )
 | 
				
			||||||
    "SECURITY_ATTRIBUTES" <c-object>
 | 
					    "SECURITY_ATTRIBUTES" <c-object>
 | 
				
			||||||
    "SECURITY_ATTRIBUTES" heap-size over set-SECURITY_ATTRIBUTES-nLength ;
 | 
					    "SECURITY_ATTRIBUTES" heap-size
 | 
				
			||||||
 | 
					    over set-SECURITY_ATTRIBUTES-nLength ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: security-attributes-inherit ( -- obj )
 | 
					: security-attributes-inherit ( -- obj )
 | 
				
			||||||
    default-security-attributes
 | 
					    default-security-attributes
 | 
				
			||||||
| 
						 | 
					@ -47,8 +48,8 @@ M: win32-file close-handle ( handle -- )
 | 
				
			||||||
! Clean up resources (open handle) if add-completion fails
 | 
					! Clean up resources (open handle) if add-completion fails
 | 
				
			||||||
: open-file ( path access-mode create-mode flags -- handle )
 | 
					: open-file ( path access-mode create-mode flags -- handle )
 | 
				
			||||||
    [
 | 
					    [
 | 
				
			||||||
        >r >r
 | 
					        >r >r share-mode security-attributes-inherit r> r>
 | 
				
			||||||
        share-mode security-attributes-inherit r> r> CreateFile-flags f CreateFile
 | 
					        CreateFile-flags f CreateFile
 | 
				
			||||||
        dup invalid-handle? dup close-later
 | 
					        dup invalid-handle? dup close-later
 | 
				
			||||||
        dup add-completion
 | 
					        dup add-completion
 | 
				
			||||||
    ] with-destructors ;
 | 
					    ] with-destructors ;
 | 
				
			||||||
| 
						 | 
					@ -95,7 +96,8 @@ M: win32-file close-handle ( handle -- )
 | 
				
			||||||
    >r (open-append) r> 2dup set-file-pointer ;
 | 
					    >r (open-append) r> 2dup set-file-pointer ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TUPLE: FileArgs
 | 
					TUPLE: FileArgs
 | 
				
			||||||
    hFile lpBuffer nNumberOfBytesToRead lpNumberOfBytesRet lpOverlapped ;
 | 
					    hFile lpBuffer nNumberOfBytesToRead
 | 
				
			||||||
 | 
					    lpNumberOfBytesRet lpOverlapped ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
C: <FileArgs> FileArgs
 | 
					C: <FileArgs> FileArgs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -195,4 +197,3 @@ M: windows addrinfo-error ( n -- )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: tcp-socket ( addrspec -- socket )
 | 
					: tcp-socket ( addrspec -- socket )
 | 
				
			||||||
    protocol-family SOCK_STREAM open-socket ;
 | 
					    protocol-family SOCK_STREAM open-socket ;
 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue