[cfe-dev] Compiling clang on Windows/TDM-GCC 4.8.1-3 (MinGW32)

Ulrich Schmidt u.sch.zw at gmx.de
Thu Sep 11 11:19:43 PDT 2014


Am 11.09.2014 um 19:46 schrieb Aaron Ballman:
> On Thu, Sep 11, 2014 at 1:32 PM, Rafael EspĂ­ndola
> <rafael.espindola at gmail.com> wrote:
>> On 11 September 2014 13:29, Eran Ifrah <eran.ifrah at gmail.com> wrote:
>>> The header file is included indirectly (<winnt.h>). However, the definitions
>>> are not visible since _WIN32_WINNT is set to a value lower than 0x0502
>>> Attached is a patch to the CMakeLists.txt file that adds
>>> -D_WIN32_WINNT=0x0502 in case of MinGW and WIN32 conditions are met
>> Not sure which one is better. Aaron, any thoughts?
> I think we should be setting WINVER and _WIN32_WINNT to
> _WIN32_WINNT_WS03 (0x0502) in WindowsSupport.h. We currently set it to
> 0x0501, and it sounds like we want to update it. I don't think that
> requiring Win XP SP 2 will be that problematic in practice, but we
> should be aware that we would be changing the minimum required version
> of Windows (slightly).
>
> ~Aaron
>
>
I use clang [2]  on win7 using MinGW32 [1]
I modified \MinGW\include\windef.h and changed the WINVER asignment:
--8X----------------------------------------------------------------------------------------------
#ifndef WINVER
// #define WINVER 0x0400
#define WINVER 0x0502
/*
  * If you need Win32 API features newer the Win95 and WinNT then you must
  * define WINVER before including windows.h or any other method of 
including
  * the windef.h header.
  */
#endif
--8X----------------------------------------------------------------------------------------------

Other clang/gcc users may adjust this value for her needs different than 
me and you.

My question:
Would it be the best way for clang to read this definition from the 
local windef.h file and use this local adjusted value?

Ulrich Schmidt.

[1]: http://sourceforge.net/projects/mingw/
[2]: http://llvm.org/releases/3.5.0/LLVM-3.5.0-win32.exe




More information about the cfe-dev mailing list