go1.8.7, go1.9.4 and go1.10+ introduced a security feature that do not allow arbitrary CGO flags, in particular -fconstant-cfstrings. This PR fixes this by removing this build flag.
Moreover go1.10+ introduces some changes in how CFRefs (and derivative pointers) are mapped in golang. This is also fixed in this PR by duplicating usb_darwin.go in two files with corresponding build tags:
usb_darwin.go that contains the implementation for go1.10 and later
usb_darwin_go1.9.go that contains the implementation for go1.9 and earlier
The implementation for go1.9 and earlier will be "freezed" and kept only for compatibility, all the bugfix and improvements will be on usb_darwin.go.
go1.8.7, go1.9.4 and go1.10+ introduced a security feature that do not allow arbitrary CGO flags, in particular
-fconstant-cfstrings
. This PR fixes this by removing this build flag.Moreover go1.10+ introduces some changes in how CFRefs (and derivative pointers) are mapped in golang. This is also fixed in this PR by duplicating
usb_darwin.go
in two files with corresponding build tags:usb_darwin.go
that contains the implementation for go1.10 and laterusb_darwin_go1.9.go
that contains the implementation for go1.9 and earlierThe implementation for go1.9 and earlier will be "freezed" and kept only for compatibility, all the bugfix and improvements will be on
usb_darwin.go
.Fix #50 @facchinm @gibranv @borud