Commit e48cd5d1 authored by Maksim Fedorov's avatar Maksim Fedorov Committed by Steven Allen

fix building under windows

parent 824c4592
...@@ -11,7 +11,7 @@ const ( ...@@ -11,7 +11,7 @@ const (
AF_UNSPEC = windows.AF_UNSPEC AF_UNSPEC = windows.AF_UNSPEC
IPPROTO_IP = windows.IPPROTO_IP IPPROTO_IP = windows.IPPROTO_IP
IPPROTO_IPV4 = windows.IPPROTO_IPV4 IPPROTO_IPV4 = 0x4 // windows.IPPROTO_IPV4 (missing)
IPPROTO_IPV6 = windows.IPPROTO_IPV6 IPPROTO_IPV6 = windows.IPPROTO_IPV6
IPPROTO_TCP = windows.IPPROTO_TCP IPPROTO_TCP = windows.IPPROTO_TCP
IPPROTO_UDP = windows.IPPROTO_UDP IPPROTO_UDP = windows.IPPROTO_UDP
......
...@@ -25,7 +25,7 @@ func sockaddrToAny(sa windows.Sockaddr) (*windows.RawSockaddrAny, Socklen, error ...@@ -25,7 +25,7 @@ func sockaddrToAny(sa windows.Sockaddr) (*windows.RawSockaddrAny, Socklen, error
for i := 0; i < len(sa.Addr); i++ { for i := 0; i < len(sa.Addr); i++ {
raw.Addr[i] = sa.Addr[i] raw.Addr[i] = sa.Addr[i]
} }
return (*windows.RawSockaddrAny)(unsafe.Pointer(&raw)), int32(unsafe.Sizeof(raw)), nil return (*windows.RawSockaddrAny)(unsafe.Pointer(&raw)), Socklen(unsafe.Sizeof(raw)), nil
case *windows.SockaddrInet6: case *windows.SockaddrInet6:
if sa.Port < 0 || sa.Port > 0xFFFF { if sa.Port < 0 || sa.Port > 0xFFFF {
...@@ -40,7 +40,7 @@ func sockaddrToAny(sa windows.Sockaddr) (*windows.RawSockaddrAny, Socklen, error ...@@ -40,7 +40,7 @@ func sockaddrToAny(sa windows.Sockaddr) (*windows.RawSockaddrAny, Socklen, error
for i := 0; i < len(sa.Addr); i++ { for i := 0; i < len(sa.Addr); i++ {
raw.Addr[i] = sa.Addr[i] raw.Addr[i] = sa.Addr[i]
} }
return (*windows.RawSockaddrAny)(unsafe.Pointer(&raw)), int32(unsafe.Sizeof(raw)), nil return (*windows.RawSockaddrAny)(unsafe.Pointer(&raw)), Socklen(unsafe.Sizeof(raw)), nil
case *windows.SockaddrUnix: case *windows.SockaddrUnix:
return nil, 0, syscall.EWINDOWS return nil, 0, syscall.EWINDOWS
...@@ -50,7 +50,7 @@ func sockaddrToAny(sa windows.Sockaddr) (*windows.RawSockaddrAny, Socklen, error ...@@ -50,7 +50,7 @@ func sockaddrToAny(sa windows.Sockaddr) (*windows.RawSockaddrAny, Socklen, error
func anyToSockaddr(rsa *windows.RawSockaddrAny) (windows.Sockaddr, error) { func anyToSockaddr(rsa *windows.RawSockaddrAny) (windows.Sockaddr, error) {
if rsa == nil { if rsa == nil {
return nil, 0, syscall.EINVAL return nil, syscall.EINVAL
} }
switch rsa.Addr.Family { switch rsa.Addr.Family {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment