Why is Linux the only OS in version identifier list that has a lowercase name?

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Apr 12 05:17:10 PDT 2016


On 4/10/16 9:19 PM, Zekereth wrote:
> On Monday, 11 April 2016 at 01:15:27 UTC, Ali Çehreli wrote:
>> As a workaround, you can set version to Linux yourself:
>>
>> version (linux) {
>>     version = Linux;
>> }
>>
>> void main() {
>>     version (Linux) {
>>         import std.stdio;
>>         writeln("Linux worked!");
>>     }
>> }
>
> That's interesting that will help. Thanks for that!

I highly recommend not to do this. New version assignments do not live 
outside the module, so you have to do this in EVERY module you want to 
use it.

Better to pass on the command line. Even better to just use the standard 
version identifier :)

-Steve


More information about the Digitalmars-d-learn mailing list