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

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Apr 10 17:51:19 PDT 2016


On Sunday, 10 April 2016 at 22:03:54 UTC, Zekereth wrote:
> So I was just testing some code and couldn't figure out why it 
> wasn't working. My version block looked like this:
>
> version(Linux)
> {
> ...
> }
>
> Looking at the list(unless I'm missing something) Linux is the 
> only OS that is lowercase. I'm guessing most people use Posix 
> instead and never encounter this problem.
>

It's an artifact of history. When this was first introduced, 
Walter's intent was to match the casing used in gcc preprocessor 
definitions. Since that time, we've standardized on 
capitalization for everything, but 'linux' lives on. I would like 
to see 'Linux' introduced for consistency and to avoid errors 
like yours (a bug lived in Phobos for a long time because of 
this) while maintaining 'linux' for backwards compatibility.


More information about the Digitalmars-d-learn mailing list