<Tool
Name="VCCLCompilerTool"
Optimization="0"
- PreprocessorDefinitions="FFI;WIN32"
+ PreprocessorDefinitions="FFI;WIN32;F_DEBUG"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
- PreprocessorDefinitions="FFI;WIN32"
+ PreprocessorDefinitions="FFI;WIN32;F_DEBUG"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
<File
RelativePath="native\cons.c">
</File>
+ <File
+ RelativePath=".\native\debug.c">
+ </File>
<File
RelativePath="native\error.c">
</File>
<File
RelativePath="native\cons.h">
</File>
+ <File
+ RelativePath=".\native\debug.h">
+ </File>
<File
RelativePath="native\error.h">
</File>
! $Id$
!
-! Copyright (C) 2003, 2004 Slava Pestov.
+! Copyright (C) 2003, 2004 Mackenzie Straight.
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions are met:
! $Id$
!
-! Copyright (C) 2004 Slava Pestov.
+! Copyright (C) 2004 Mackenzie Straight.
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions are met:
! $Id$
!
-! Copyright (C) 2004 Slava Pestov.
+! Copyright (C) 2004 Mackenzie Straight.
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions are met:
! $Id$
!
-! Copyright (C) 2004 Slava Pestov.
+! Copyright (C) 2004 Mackenzie Straight.
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions are met:
f free-list set
] extend io-queue set ;
+: add-completion ( handle -- )
+ completion-port get NULL 1 CreateIoCompletionPort drop ;
+
: get-access ( -- file-mode )
"file-mode" get uncons
GENERIC_WRITE 0 ? >r
cons "file-mode" set
get-access get-sharemode NULL get-create FILE_FLAG_OVERLAPPED NULL
CreateFile dup INVALID_HANDLE_VALUE = [ win32-throw-error ] when
- dup completion-port get NULL 1 CreateIoCompletionPort drop
+ dup add-completion
] with-scope ;
BEGIN-STRUCT: indirect-pointer
! $Id$
!
-! Copyright (C) 2004 Slava Pestov.
+! Copyright (C) 2004 Mackenzie Straight.
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions are met:
: <win32-client-stream> ( buf stream -- stream )
[
buffer-ptr <alien> 0 32 32
- <sockaddr-in> dup >r <indirect-pointer> <sockaddr-in> dup >r over
- GetAcceptExSockaddrs r> r> drop
+ <sockaddr-in> dup >r <indirect-pointer> <sockaddr-in> dup >r
+ <indirect-pointer> GetAcceptExSockaddrs r> r> drop
dup sockaddr-in-port ntohs swap sockaddr-in-addr inet-ntoa
[ , ":" , unparse , ] make-string "client" set
] extend ;
C: win32-server ( port -- server )
[
maybe-init-winsock new-socket swap over bind-socket dup listen-socket
- dup completion-port get NULL 1 CreateIoCompletionPort drop
+ dup add-completion
socket set
] extend ;
M: win32-server accept ( server -- client )
[
+ new-socket 1024 <buffer>
[
- new-socket "ns" set 1024 <buffer> "buf" set
- [
- alloc-io-task init-overlapped >r
- socket get "ns" get "buf" get buffer-ptr <alien> 0
- "sockaddr-in" size 16 + dup NULL r> AcceptEx
- [ handle-socket-error ] unless (yield)
- ] callcc0
- "buf" get "ns" get
- dup completion-port get NULL 1 CreateIoCompletionPort drop
- <win32-stream> <win32-client-stream>
- "buf" get buffer-free
- ] with-scope
+ alloc-io-task init-overlapped >r >r >r socket get r> r>
+ buffer-ptr <alien> 0 "sockaddr-in" size 16 + dup NULL r> AcceptEx
+ [ handle-socket-error ] unless (yield)
+ ] callcc0
+ swap dup add-completion <win32-stream> dupd <win32-client-stream>
+ swap buffer-free
] bind ;
! $Id$
!
-! Copyright (C) 2004 Slava Pestov.
+! Copyright (C) 2004 Mackenzie Straight.
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions are met:
! $Id$
!
-! Copyright (C) 2004 Slava Pestov.
+! Copyright (C) 2004 Mackenzie Straight.
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions are met:
! $Id$
!
-! Copyright (C) 2004 Slava Pestov.
+! Copyright (C) 2004 Mackenzie Straight.
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions are met:
! $Id$
!
-! Copyright (C) 2004 Slava Pestov.
+! Copyright (C) 2004 Mackenzie Straight.
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions are met: