Is __VERSION__ cross-compiler compatible?

Andrew Wiley wiley.andrew.j at gmail.com
Tue Nov 22 03:35:24 PST 2011


On Mon, Nov 21, 2011 at 8:16 PM, Andrej Mitrovic
<andrej.mitrovich at gmail.com> wrote:
> GDC does seem to use this, now that I've tested it:
>
> D:\dev\code\d_code>gdc test.d
> 1067L
>
> D:\dev\code\d_code>gdc -v2 test.d
> 2052L
>
> I've found the docs, it states this is a compiler token:
> http://d-programming-language.org/lex.html (section Special Tokens)
>
> But being able to target a *language version* in a compiler-neutral
> way would be great. I don't know if LDC does the same thing as GDC
> though.
>

Odds are good that this value is part of the frontend, in which case
it would be identically in LDC and GDC.


More information about the Digitalmars-d-learn mailing list