Don't assume libusb headers are always in libusb-1.0.
Use pkg-config to add correct include paths for libusb regardless of the platform.
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
package usb
|
package usb
|
||||||
|
|
||||||
// #include <libusb-1.0/libusb.h>
|
// #include <libusb.h>
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
package usb
|
package usb
|
||||||
|
|
||||||
// #include <libusb-1.0/libusb.h>
|
// #include <libusb.h>
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
type Class uint8
|
type Class uint8
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
package usb
|
package usb
|
||||||
|
|
||||||
// #include <libusb-1.0/libusb.h>
|
// #include <libusb.h>
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
type Descriptor struct {
|
type Descriptor struct {
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
package usb
|
package usb
|
||||||
|
|
||||||
// #include <libusb-1.0/libusb.h>
|
// #include <libusb.h>
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
package usb
|
package usb
|
||||||
|
|
||||||
// #include <libusb-1.0/libusb.h>
|
// #include <libusb.h>
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@@ -19,7 +19,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
// #include <libusb-1.0/libusb.h>
|
// #include <libusb.h>
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
type usbError C.int
|
type usbError C.int
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include <libusb-1.0/libusb.h>
|
#include <libusb.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
package usb
|
package usb
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#include <libusb-1.0/libusb.h>
|
#include <libusb.h>
|
||||||
|
|
||||||
int submit(struct libusb_transfer *xfer);
|
int submit(struct libusb_transfer *xfer);
|
||||||
void print_xfer(struct libusb_transfer *xfer);
|
void print_xfer(struct libusb_transfer *xfer);
|
||||||
|
@@ -16,11 +16,8 @@
|
|||||||
// Package usb provides a wrapper around libusb-1.0.
|
// Package usb provides a wrapper around libusb-1.0.
|
||||||
package usb
|
package usb
|
||||||
|
|
||||||
// #cgo windows CFLAGS: -ID:/lib/libusb-1.0.19/include
|
// #cgo pkg-config: libusb-1.0
|
||||||
// #cgo windows,amd64 LDFLAGS: D:/lib/libusb-1.0.19/MinGW64/static/libusb-1.0.a
|
// #include <libusb.h>
|
||||||
// #cgo windows,386 LDFLAGS: D:/lib/libusb-1.0.19/MinGW32/static/libusb-1.0.a
|
|
||||||
// #cgo !windows LDFLAGS: -lusb-1.0
|
|
||||||
// #include <libusb-1.0/libusb.h>
|
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
Reference in New Issue
Block a user