On Tue, Nov 03, 2015, David Grayson wrote:
> Both mingw-w64 and libusb-compat define a header called "usb.h".   This issue 
> was sort of discussed on this mailing list five years ago:
> 
> https://sourceforge.net/p/mingw-w64/mailman/mingw-w64-public/thread/aanlkti%[email protected]/?page=1
> 
> Back then, Xiaofan was arguing that mingw-w64 breaks a lot of Linux software 
> that expects "#include <usb.h>" to bring in the libusb-compat library's 
> header file instead of the mingw-w64 header file. I actually am having the 
> opposite problem: MSYS2 installs libusb-compat's usb.h inside 
> /mingw64/include/, which has a higher precendence than the mingw-w64 headers, 
> so including usb.h always gives you the libusb-compat header if that package 
> is installed.
> 
> This problem cannot be fixed with a simple -I flag because of a quirk in how 
> GCC's search path works:

I see that libusb avoids using a toplevel system include directory. Do
you really need the -compat stuff?
Moreover there's a .pc file for libusb-compat; if build systems rely on
pkg-config in practice, then it is trivial to move the file to a sane
directory and update the .pc file to reflect that.

> > You can add to this list with the `-Idir` command-line option.
> > All the directories named by `-I` are searched, in left-to-right
> > order, before the default directories. The only exception is
> > when dir is already searched by default. In this case, the
> > option is ignored and the search order for system directories
> > remains unchanged.
> 
> To build the MSYS2 usbview package, we resorted to copying usb.h into a local 
> directory and adding that directory to the search path with -I.
> 
> This patch helps to address this issue by simply changing angle-brackets to 
> double quotes in the two places that include usb.h (winusbio.h and usbdi.h).  
> This guarantees that those two include statements will work as expected.  
> External source code that wants to include the mingw-w64 usb.h can simply be 
> patched to include usbdi.h instead, which in turn includes the correct usb.h 
> using quotes.

Let's suppose mingw-w64 should adapt. What about the build of
libusb-compat under MSVC?

Really, there's a platform and software is built on top of it; it is
that software that is supposed to adapt to the platform.

-- 
Adrien Nader

------------------------------------------------------------------------------
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to