Unverified Commit d0ced09a authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #18 from libp2p/feat/remove-cgo

fix: remove CGO functions
parents 681f967f b951524a
package sockaddr
import (
"C"
"unsafe"
sockaddrnet "github.com/libp2p/go-sockaddr/net"
)
// AnyToCAny casts a *RawSockaddrAny to a *C.struct_sockaddr_any
func AnyToCAny(a *sockaddrnet.RawSockaddrAny) *C.struct_sockaddr_any {
return (*C.struct_sockaddr_any)(unsafe.Pointer(a))
}
// CAnyToAny casts a *C.struct_sockaddr_any to a *RawSockaddrAny
func CAnyToAny(a *C.struct_sockaddr_any) *sockaddrnet.RawSockaddrAny {
return (*sockaddrnet.RawSockaddrAny)(unsafe.Pointer(a))
}
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