mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
Fixed get_error_msg for *nix
* Fixed undefined: get_error_msg
This commit is contained in:

committed by
Alexander Medvednikov

parent
67c2932f34
commit
d6ddfa124d
@ -3,3 +3,23 @@ module net
|
||||
#flag -lws2_32
|
||||
#include <winsock2.h>
|
||||
#include <Ws2tcpip.h>
|
||||
|
||||
// Ref - https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-wsastartup
|
||||
const (
|
||||
WSA_V1 = 0x100 // C.MAKEWORD(1, 0)
|
||||
WSA_V11 = 0x101 // C.MAKEWORD(1, 1)
|
||||
WSA_V2 = 0x200 // C.MAKEWORD(2, 0)
|
||||
WSA_V21 = 0x201 // C.MAKEWORD(2, 1)
|
||||
WSA_V22 = 0x202 // C.MAKEWORD(2, 2)
|
||||
)
|
||||
|
||||
pub fn socket(family int, stype int, prototype int) Socket {
|
||||
sockfd := C.socket(family, _type, proto)
|
||||
s := Socket {
|
||||
sockfd: sockfd
|
||||
family: family
|
||||
_type: _type
|
||||
proto: proto
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
Reference in New Issue
Block a user