Using two flags in conditonal compilation (version)

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


On Wednesday, 25 June 2014 at 20:30:28 UTC, Justin Whear wrote:
> I think you mean ||, not &&.  The best way I know around this 
> is to
> define enums:
>
> version (DigitalMars)
>    enum compiler_DigitalMars = true;
> else
>    enum compiler_DigitalMars = false;
>
> //... similar for LDC
>
> static if (compiler_DigitalMars || compiler_LDC)
> {
>    ...
> } else {
>    ...
> }
Yeah, I mean ||. Your solution works, thanks a lot!


More information about the Digitalmars-d-learn mailing list