Version Identifiers for Platforms / Architectures not supported by DMD

Alex Rønne Petersen xtzgzorex at gmail.com
Mon Nov 7 13:27:06 PST 2011


On 07-11-2011 14:59, Alex Rønne Petersen wrote:
> On 07-11-2011 14:20, Nick Sabalausky wrote:
>> "Walter Bright"<newshound2 at digitalmars.com> wrote in message
>> news:j9784p$24tu$1 at digitalmars.com...
>>>
>>> Based on my research:
>>>
>>> _WIN32 Microsoft NT, Windows 95, Windows 98, Win32s,
>>> Windows 2000
>>> _WIN64 Windows for AMD64
>>> linux Linux
>>> __APPLE__ Mac OSX
>>> __FreeBSD__ FreeBSD
>>> __OpenBSD__ OpenBSD
>>> __sun&&__SVR4 Solaris, OpenSolaris (yes, both macros are
>>> necessary)
>>>
>>> Hence FreeBSD rather than freebsd or Freebsd. The underscores just
>>> looked
>>> awful :-) and are unnecessary for D since the version tags are in a
>>> separate namespace.
>>>
>>> Had to come up with one for Solaris.
>>>
>>> APPLE is hopelessly generic, considering Apple has produced many
>>> operating
>>> systems.
>>>
>>> __WINDOWS__ is not what DMC uses. See
>>>
>>> http://www.digitalmars.com/ctg/predefined.html
>>>
>>
>> You're completely contradicting your claim here of having used the gcc
>> idents. Obviously you changed the idents, and you had a reason for
>> each one.
>> There's pretty damn good reason for changing "linux" too.
>>
>> At least Phobos is finally ditching the absolutely rediculous
>> philosophy of
>> "always use naming conventions from random other places, and don't
>> ever even
>> think about being internally-consistent".
>>
>>> Some people have protested that I have "trivialized" Linux by using
>>> "linux", but I am perplexed why that's ok for gcc but not for D.
>>>
>>
>> Strawman.
>>
>>> And finally, there is no such thing as a "sane" version identifier
>>> scheme.
>>> For one thing, OS vendors do not pick sane names. OS/2 is not an
>>> identifier. Neither is OS X. Nor is GNU/Linux. Nor do the OS vendors
>>> pick
>>> any sane identifiers for their own systems (look at what Sun did).
>>
>> You're really stretching to say those aren't "sane" names. They're just
>> names, they're not even intended to be identifiers. To make identifiers
>> *for* them, removing the illegal chars (and using a non-schizophrenic
>> casing
>> scheme) is an obvious and non-problematic solution. Picking *ONE* of
>> them to
>> be lowercased instead of upper camel cased like the rest (or any other
>> inconsistent casing) isn't merely "not sane", it's also completely
>> unnecessary.
>>
>>>
>>> Even if someone comes up with a naming scheme for D that most agree is
>>> sane, intuitive, and attractive, switching to it would again silently
>>> break a large swath of existing D code. D cannot advance by constantly
>>> breaking things.
>>
>> Adding "Linux" as a preferred alternative to "linux" will not break large
>> swaths of code.
>>
>>
>
> Yes, this would be a good idea. This approach could deprecate 'linux' in
> favor of 'Linux' as 'darwin' was deprecated in favor of 'OSX'.
>
> - Alex

I propose: https://github.com/D-Programming-Language/dmd/pull/501

- Alex


More information about the Digitalmars-d mailing list