Hi, D community.<div><br></div><div>I have C code (*cough* WinAPI *cough*) like:</div><div><br></div><div>#if FOOBAR == 1</div><div>#define SOMETHING</div><div>#elif FOOBAR > 2</div><div>#define SOMETHING</div><div>#elif FOOBAR < 5</div>
<div>#define SOMETHING</div><div>#endif<br clear="all"><div><br></div><div>Which I want to translate to D.</div><div><br></div><div>Here are the problems I have:</div><div>1. I can't use versions because:</div><div>    1.1. The identifier version won't work because the set of values for FOOBAR is unknown, thus cannot be enumerated as different version identifiers.</div>
<div>    1.2. The number version won't work because there are tons of other things like FOOBAR and they can't all use the version number.</div><div>2. I can't use static if because:</div><div>    2.1. I can't define FOOBAR from outside of the package this code will be in.</div>
<div>    2.2. I can't include the definition of FOOBAR into the package (like config.d) and expect it to be changed as necessary, because the package encapsulation will be broken.</div><div><br></div><div><div>What's the best/standard way translating this to D?</div>
</div><div><br></div>-- <br>Bye,<br>Gor Gyolchanyan.<br>
</div>