On Sun, Sep 12, 2010 at 5:26 PM, Ruben Van Boxem
<[email protected]> wrote:
>> building. What is the easy way to differentiate MinGW-w64
>> 32bit compiler and MinGW.org 32bit compiler? Then we
>> can add ifdefs in the source codes to cater for both in the
>> future.
>>
>> The current codes are set up in a way to support MinGW.org
>> for 32bit build and MinGW-w64 64bit for 64bit build.
>
> The way WebKit does this is the following:
>
>> #if defined(__MINGW32__) /* compiler built-in define for all mingw
>> compilers */
>>   // general mingw code
>> #include <_mingw.h> /* private MinGW header */
>>     #if defined(__MINGW64_VERSION_MAJOR) /* best way to check for
>> mingw-w64 vs mingw.org */
>>         /* mingw-w64/w32 specific code */
>>
>>     #else
>>
>>         /* mingw.org specific code */
>>
>>     #endif /* __MINGW64_VERSION_MAJOR */
>>
>> #endif /* __MINGW32__ */
>
> They define some macro used by special macro functions (see
> JavaScriptCore/wtf/Platform.h):
>>
>> #if OS(WINDOWS)
>> #if COMPILER(MINGW) && !COMPILER(MINGW64)
>>    /* do something mingw.org specific */
>> #elif COMPILER(MSVC) || COMPILER(MINGW64)
>>   /* other stuff */
>> #endif
>> #endif
>
> I hope this helps!

Ah this should work. Thanks.

One more thing, the following is a problem for us.

On Thu, Sep 9, 2010 at 3:53 AM, Ozkan Sezer <[email protected]> wrote:
> 2. the name of your src/usb.h is, well, usb.h, and it conflicts, ie.
> searched before the system provided usb.h.  Therefore, it must be
> renamed to something else.  For my own tests, I renamed it to
> usb_private.h and changed all occurences of #include "usb.h" (with
> quotes) to use the new name.

 The usb.h header file is the chosen header file name by the founder
of libusb-win32 project. In the old days (MinGW.org) this is not an
issue since the MinGW.org "usb.h" is inside <ddk/usb.h>. Now
MinGW-w64 provides the "usb.h" inside the system include
directory. Not so sure if there is a good solution. Probably
we have to ask users to put the header inside <libusb-win32/usb.h>
but this may break other software packages which expect to
have libusb-win32 "usb.h" inside the system include directory.


-- 
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to