www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - DMD Compiler Version Dependent Conditional Compilation

reply =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= <per.nordlow gmail.com> writes:
Can I use the version keyword or static if to perform conditional 
compilation  that depends on the version of DMD?

I typicall something like

version(>= DMD_2.0.66)
{
     // use new byChar, byWchar, byDchar, byCodepoint
}
else
{
     // use old style slower version
}

If so how?
Jun 09 2014
parent reply "David Nadlinger" <code klickverbot.at> writes:
On Monday, 9 June 2014 at 17:36:10 UTC, Nordlöw wrote:
 Can I use the version keyword or static if to perform 
 conditional compilation  that depends on the version of DMD?
The __VERSION__ magic token should do the job. David
Jun 09 2014
parent =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= <per.nordlow gmail.com> writes:
Thx
Jun 09 2014