[llvm-commits] _WIN32_WINNT as predefined (was Re: [Review request][Win64] Patches for Mingw-w64(and mingw64-clang))

NAKAMURA Takumi geek4civic at gmail.com
Sun Feb 6 18:06:26 PST 2011


Anton gave me a comment on the github for:
* 0004-lib-Support-Windows-Windows.h-Autoconf-provides-.patch.txt
> View Commit: https://github.com/chapuni/LLVM/commit/45be38ca409cbbdf2b63be2eaf7bf230aa9d6b38

> I don't think this is a good way of doing thing. You're passing platform-dependent macros to all files, even those which do not include windows.h. These #define's should be localized in windows-only places (e.g. libSupport)

In the case of mingw-w64, _WIN32_WINNT would be defined (as 0x0502) by
system headers even if we did not provide predefined _WIN32_WINNT. In
reverse, predefined _WIN32_WINNT might affect to system headers on
mingw-w64.

IMHO, _WIN32_WINNT (and similar) is not "platform-dependent macro". I
think it could be done even if _WIN32_WINNT were defined on command
line (-D_WIN32_WINNT=0x0500).

Similarly, I think, also, _GNU_SOURCE could be defined in config.h
(not llvm-config.h).
and definitions in command line might be reduced as possible.

May I reopen PR7809 - TargetSelect.h shouldn't include llvm/Config/config.h ?
http://llvm.org/bugs/show_bug.cgi?id=7809
In TOT, a few headers depend on llvm/Config/config.h.

Thank you,
...Takumi



More information about the llvm-commits mailing list