Is __VERSION__ cross-compiler compatible?

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon Nov 21 18:16:04 PST 2011


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.


More information about the Digitalmars-d-learn mailing list