Using two flags in conditonal compilation (version)

Danyal Zia via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 25 13:24:30 PDT 2014


Hi, In the development of my library, I'm in a position where I 
need to add support for multiple compilers. For instance, 
supporting both the assembly of LDC/DMD and GDC. I want to do 
something like:

version(DigitalMars && LDC)
{
}

However, it doesn't compile which forces me to rewrote the same 
code for both DigitalMars and LDC

version(DigitalMars)
{
}

version(LDC)
{
}

Is there a way to check both versions at the same time? (I can't 
seem to find the solution through google, sorry)

Thanks,
Danyal Zia


More information about the Digitalmars-d-learn mailing list