Boost logo

Boost :

Subject: Re: [boost] [PREDEF] Review for the Boost.Predef library by Rene Riviera
From: Joshua Boyce (raptorfactor_at_[hidden])
Date: 2012-02-20 07:56:37


On Mon, Feb 20, 2012 at 7:06 PM, Artyom Beilis <artyomtnk_at_[hidden]> 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.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk