windows.winsock: the servent structure is different between 32-bit and 64-bit.

db4
John Benediktsson 2013-09-25 11:39:27 -07:00
parent a8691d6dc9
commit db3d5f48cc
3 changed files with 23 additions and 8 deletions

View File

@ -0,0 +1,8 @@
USING: alien.c-types classes.struct ;
IN: windows.winsock.32
STRUCT: servent
{ name c-string }
{ aliases void* }
{ port int }
{ proto c-string } ;

View File

@ -0,0 +1,8 @@
USING: alien.c-types classes.struct ;
IN: windows.winsock.64
STRUCT: servent
{ name c-string }
{ aliases void* }
{ proto c-string }
{ port int } ;

View File

@ -3,11 +3,16 @@
USING: accessors alien alien.c-types alien.data alien.strings
alien.syntax arrays byte-arrays classes.struct grouping init
io.encodings.utf16n kernel literals math math.bitwise
math.parser sequences windows.com.syntax windows.errors
windows.kernel32 windows.types ;
math.parser sequences system vocabs.parser windows.com.syntax
windows.errors windows.kernel32 windows.types ;
FROM: alien.c-types => short ;
IN: windows.winsock
<<
! Some differences between Win32 and Win64
cpu x86.64? "windows.winsock.64" "windows.winsock.32" ? use-vocab
>>
TYPEDEF: int* SOCKET
: <wsadata> ( -- byte-array )
@ -146,12 +151,6 @@ STRUCT: timeval
{ sec long }
{ usec long } ;
STRUCT: servent
{ name c-string }
{ aliases void* }
{ port int }
{ proto c-string } ;
GENERIC: sockaddr>ip ( sockaddr -- string )
M: sockaddr-in sockaddr>ip ( sockaddr -- string )