[llvm-commits] [llvm] r125171 - /llvm/trunk/lib/Support/Windows/Windows.h

NAKAMURA Takumi geek4civic at gmail.com
Wed Feb 9 01:59:52 PST 2011


On Wed, Feb 9, 2011 at 3:36 PM, Anton Korobeynikov
<anton at korobeynikov.info> wrote:
>> +// mingw-w64 tends to define it as 0x0502 in its headers.
>> +#undef _WIN32_WINNT
>> +
>>  // Require at least Windows 2000 API.
>>  #define _WIN32_WINNT 0x0500
>>  #define _WIN32_IE    0x0500 // MinGW at it again.
> Ok, now the question: why can't we have 0x0500 for mingw32 and 0x0502
> for mingw64 here?

We assume we could not know whether _WIN32_WINNT := 0x0502 or not
until including anything (_mingw.h, std*.h, &c).
Note that both {i686|x86_64}-w64-mingw32 (not pc-mingw32) have such behavior.

If we could honor system header's _WIN32_WINNT, it would be possible;
(but weird!)

#include <sys/types.h> /* anything available on msvc and mingw! */
#ifdef _WIN32_WINNT
#  if _WIN32_WINNT<0x0500
#    error "W2k?"
#  endif
#else
#  ifdef _WIN64
#    define _WIN32_WINNT 0x0502 /* at least Windows XP SP2 */
#  else
#    define _WIN32_WINNT 0x0500 /* W2k */
#  endif
#endif


...Takumi




More information about the llvm-commits mailing list