version: multiple conditions

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 15 03:56:43 PDT 2015


On Mon, 15 Jun 2015 17:25:07 +0900, Mike Parker wrote:

> On 6/14/2015 10:36 PM, "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?=
> <ola.fosheim.grostad+dlang at gmail.com>" wrote:
>> On Sunday, 14 June 2015 at 13:02:03 UTC, Manfred Nowak wrote:
>>> bitwise wrote:
>>>
>>>> for at least adding "||" so that code can be shared between
>>>> platforms?
>>>
>>> Sureley it is a pita to write:
>>>
>>> version( iOS) version= iOS;
>>> else version( Android) version= Android;
>>> else version= neither;
>>> version( neither) version= neither; else version=iOSorAndroid;
>>>
>>> version( iOSorAndroid){
>>>    // ...
>>> }
>>
>> It is, but it is only a 0.0001% source code increase that can be hidden
>> in a config file.
>>
> Not using version statements. They only apply to the module in which
> they are declared. To use it in multiple modules, you need static if and
> enums. I like that better than the version statements anyway, so if we
> aren't going to ever get boolean versions, I'll settle for the static if
> approach.

if only there is a way to define such enums from command line, akin to "-
version"...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150615/7eae2ff9/attachment.sig>


More information about the Digitalmars-d mailing list