Skip to content

Commit 033849e

Browse files
authored
Merge pull request #10 from Hades32/windows-compat
allow compilation on windows
2 parents 2fd43cd + 6d2b104 commit 033849e

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

constants_windows.go

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package can
2+
3+
// TODO(brutella) implement
4+
const AF_CAN = -1

readwritecloser_windows.go

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package can
2+
3+
import (
4+
"fmt"
5+
"net"
6+
)
7+
8+
func NewReadWriteCloserForInterface(i *net.Interface) (ReadWriteCloser, error) {
9+
return nil, fmt.Errorf("Binding to can interface no supported on Windows")
10+
}

socket_windows.go

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package can
2+
3+
import "syscall"
4+
5+
// NewSockaddr returns a socket address based on the protocol and interface index.
6+
// TODO(brutella) This method has no implementation.
7+
func NewSockaddr(proto uint16, Ifindex int) syscall.Sockaddr {
8+
return &syscall.SockaddrUnix{}
9+
}

0 commit comments

Comments
 (0)