[libhid-discuss] Internal definition of struct usb_dev_handle breaks portability

Charles Lepple clepple at ghz.cc
Sat Mar 31 14:32:03 UTC 2007


On Mar 30, 2007, at 9:22 PM, Albert Lee wrote:

> Actually, it compiled and linked (after some build system changes),  
> but segfaulted at runtime since the struct contents were different  
> from the private copy's. libusb on Solaris doesn't actually expose  
> the definition of usb_dev_handle, but the interface accepts  
> pointers to it. In the attached patch I have changed the code to  
> just use struct usb_device.

Yikes. When you said "internal copies of usb_dev_handle", I thought  
you meant we were saving the pointer when we shouldn't.

Just applied it to the SVN repository.

There are a number of other places that I need to clean up, such as  
the magic with reading the version number from the Debian changelog  
(the new trend is for Debian developers to keep the packaging info  
separate from the upstream source), and maybe moving all the  
usb_dev_handle forward struct definitions into a private header file.

Thanks for the patch.

-- 
Charles Lepple




More information about the libhid-discuss mailing list