Bug 279556 - libusb_hotplug_callback_handle type incompatibility between FreeBSD and libusb
Summary: libusb_hotplug_callback_handle type incompatibility between FreeBSD and libusb
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-usb (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-06 13:52 UTC by Ed Maste
Modified: 2024-08-30 22:32 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2024-06-06 13:52:00 UTC
See PR277799 for background. libusb_hotplug_callback_handle_struct has a different type between FreeBSD and libusb

FreeBSD:

lib/libusb/libusb.h:typedef struct libusb_hotplug_callback_handle_struct *libusb_hotplug_callback_handle;

libusb:

libusb/libusb.h:typedef int libusb_hotplug_callback_handle;

which caused a build failure:

../keepassxc-2.7.7/src/gui/osutils/nixutils/DeviceListenerLibUsb.cpp:71:21: error: no matching function for call to 'libusb_hotplug_register_callback'
   71 |     const int ret = libusb_hotplug_register_callback(
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/libusb.h:597:5: note: candidate function not viable: no known conversion from 'int *' to 'libusb_hotplug_callback_handle *' (aka 'libusb_hotplug_callback_handle_struct **') for 9th argument
  597 | int     libusb_hotplug_register_callback(libusb_context *ctx, libusb_hotplug_event events, libusb_hotplug_flag flags, int vendor_id, int product_id, int dev_class, libusb_hotplug_callback_fn cb_fn, void *user_data, libusb_hotplug_callback_handle *handle);
      |         ^                                                                                                                                                                                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~