diff options
-rw-r--r-- | gusb/gusb-device.c | 11 | ||||
-rw-r--r-- | meson.build | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gusb/gusb-device.c b/gusb/gusb-device.c index 32c3213..16a5527 100644 --- a/gusb/gusb-device.c +++ b/gusb/gusb-device.c @@ -214,13 +214,22 @@ g_usb_device_init (GUsbDevice *device) /* not defined in FreeBSD */ #ifndef HAVE_LIBUSB_GET_PARENT -libusb_device * +static libusb_device * libusb_get_parent (libusb_device *dev) { return NULL; } #endif +/* not defined in DragonFlyBSD */ +#ifndef HAVE_LIBUSB_GET_PORT_NUMBER +static guint8 +libusb_get_port_number (libusb_device *dev) +{ + return 0xff; +} +#endif + static void g_usb_device_build_parent_port_number (GString *str, libusb_device *dev) { diff --git a/meson.build b/meson.build index 128ad6e..3f50b7c 100644 --- a/meson.build +++ b/meson.build @@ -107,6 +107,9 @@ endif if cc.has_header_symbol('libusb-1.0/libusb.h', 'libusb_get_parent') conf.set('HAVE_LIBUSB_GET_PARENT', '1') endif +if cc.has_header_symbol('libusb-1.0/libusb.h', 'libusb_get_port_number') + conf.set('HAVE_LIBUSB_GET_PORT_NUMBER', '1') +endif gusb_deps = [ libgio, |