Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-sockaddr
Commits
e48cd5d1
Commit
e48cd5d1
authored
Nov 08, 2017
by
Maksim Fedorov
Committed by
Steven Allen
Nov 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix building under windows
parent
824c4592
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
net/net_windows.go
net/net_windows.go
+1
-1
sockaddr_windows.go
sockaddr_windows.go
+3
-3
No files found.
net/net_windows.go
View file @
e48cd5d1
...
...
@@ -11,7 +11,7 @@ const (
AF_UNSPEC
=
windows
.
AF_UNSPEC
IPPROTO_IP
=
windows
.
IPPROTO_IP
IPPROTO_IPV4
=
windows
.
IPPROTO_IPV4
IPPROTO_IPV4
=
0x4
//
windows.IPPROTO_IPV4
(missing)
IPPROTO_IPV6
=
windows
.
IPPROTO_IPV6
IPPROTO_TCP
=
windows
.
IPPROTO_TCP
IPPROTO_UDP
=
windows
.
IPPROTO_UDP
...
...
sockaddr_windows.go
View file @
e48cd5d1
...
...
@@ -25,7 +25,7 @@ func sockaddrToAny(sa windows.Sockaddr) (*windows.RawSockaddrAny, Socklen, error
for
i
:=
0
;
i
<
len
(
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
:
if
sa
.
Port
<
0
||
sa
.
Port
>
0xFFFF
{
...
...
@@ -40,7 +40,7 @@ func sockaddrToAny(sa windows.Sockaddr) (*windows.RawSockaddrAny, Socklen, error
for
i
:=
0
;
i
<
len
(
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
:
return
nil
,
0
,
syscall
.
EWINDOWS
...
...
@@ -50,7 +50,7 @@ func sockaddrToAny(sa windows.Sockaddr) (*windows.RawSockaddrAny, Socklen, error
func
anyToSockaddr
(
rsa
*
windows
.
RawSockaddrAny
)
(
windows
.
Sockaddr
,
error
)
{
if
rsa
==
nil
{
return
nil
,
0
,
syscall
.
EINVAL
return
nil
,
syscall
.
EINVAL
}
switch
rsa
.
Addr
.
Family
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment