
On Mon, Feb 20, 2012 at 7:06 PM, Artyom Beilis <artyomtnk@yahoo.com> wrote:
For example OS Version for Windows... There are macros like _WIN32_WINNT (AFAIR) that gives you quite nice OS version.
_WIN32_WINNT, WINVER, NTDDI_VERSION, etc are macros that are defined by user code to state what the minimum OS being targeted is. If it is not defined by user code it will default to the SDK version. (e.g. If you're using the Vista SDK it will default to Vista and make available all the Vista APIs) I'm not quite sure whether you meant you wanted to detect the OS that the code is currently being compiled under, or the OS being targeted, but these macros can only be used for the latter. (I assume that's what you meant anyway as I can't think of a use-case for the former, but I figured I'd check anyway...) If detecting the version being targeted is what you meant, then I agree that could be useful, as the state of the macros is kind-of messy*, and even if you define NTDDI_VERSION, in some cases it won't correctly define _WIN32_WINNT and/or WINVER, despite MSDN saying that it should. But I digress... * http://blogs.msdn.com/b/oldnewthing/archive/2007/04/11/2079137.aspx
There is no "Cygwin" compiler or "MINGW" compiler, it is GCC. Should be fixed
I think that it is useful, even if it's in the wrong category. I also think it could be improved. Specifically, I would like to be able to differentiate between MinGW and MinGW-w64.