summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gusb/gusb-device.c9
-rw-r--r--meson.build3
2 files changed, 12 insertions, 0 deletions
diff --git a/gusb/gusb-device.c b/gusb/gusb-device.c
index 3f782f3..32c3213 100644
--- a/gusb/gusb-device.c
+++ b/gusb/gusb-device.c
@@ -212,6 +212,15 @@ g_usb_device_init (GUsbDevice *device)
device->priv = g_usb_device_get_instance_private (device);
}
+/* not defined in FreeBSD */
+#ifndef HAVE_LIBUSB_GET_PARENT
+libusb_device *
+libusb_get_parent (libusb_device *dev)
+{
+ return NULL;
+}
+#endif
+
static void
g_usb_device_build_parent_port_number (GString *str, libusb_device *dev)
{
diff --git a/meson.build b/meson.build
index ba1f314..128ad6e 100644
--- a/meson.build
+++ b/meson.build
@@ -104,6 +104,9 @@ endif
if cc.has_header_symbol('libusb-1.0/libusb.h', 'libusb_set_option')
conf.set('HAVE_LIBUSB_SET_OPTION', '1')
endif
+if cc.has_header_symbol('libusb-1.0/libusb.h', 'libusb_get_parent')
+ conf.set('HAVE_LIBUSB_GET_PARENT', '1')
+endif
gusb_deps = [
libgio,