On Tue, Sep 21, 2010 at 8:27 AM, JonY <jo...@users.sourceforge.net> wrote: >>> Long time reader of this discussion :) >>> Why not just add this to the bottom/top of libusb's usb.h header: >>> >>>> #ifdef __MINGW64_VERSION_MAJOR >>>> >>>> #include_next<usb.h> >>>> >>>> #endif // __MINGW64_VERSION_MAJOR
Actually it is not libusb-win32's usb.h header file which needs changes, but rather projects using libusb-win32. libusb-win32 is a library which provides its own usb.h header. So the above change is not for projects using libusb-win32. >> Thanks. I am not familiar with include_next. In this case, >> where should we ask the user to put libusb-win32's usb.h >> file? In its own separate directory? And how to get >> the compiler use libusb-win32's usb.h before >> the MinGW-w64 usb.h? >> > libusb usb.h can live in its own dir. All that is needed is the proper -I. > In libusb usb.h, use #include_next to include mingw-w64 usb.h. > > Its that simple. I see. So the proper solution is something like this. 1) Ask the user to put libusb-win32 usb.h inside a separate directory, say MinGW-w64 include\libusb-win32\usb.h and put the import library libusb.a in MinGW-w64's lib folder. 2) Ask the user to include proper -I directive to include the libusb-win32 usb.h instead of MinGW-w64 usb.h 3) If the user needs both, then he can use the above and then use #include_next to include mingw-w64 usb.h. Right now I do not think there are really many users of case 3). Asking the users to do 1) and 2) will probably take some time. I will check with libftdi and OpenOCD projects first. For MinGW users who use libusb-win32, typically they will just put libusb-win32 usb.h in the include directory and libusb.a in the lib directory. So this practice needs to be changed as well. All in all, it will probably take some time for projects to be changed. It is not that simple after all since it is out of our control. Anyway, we do not officially support MinGW-w64 right now. So this problem will push our efforts to support MinGW-w64 further. But we would like to support MinGW-w64 and we will need to gather inputs from projects using libusb-win32. -- Xiaofan ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public