[Issue 2021] version(linux) is inconsistent

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 21 16:41:27 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2021





------- Comment #3 from wbaxter at gmail.com  2008-04-21 18:41 -------
(In reply to comment #2)

> Anyway, the whole issue was brought up years ago (2005) and should be a
> WONTFIX. See for instance
> http://www.digitalmars.com/d/archives/digitalmars/D/37778.html#N37933 and
> http://www.digitalmars.com/d/archives/D/gnu/1208.html.

Those threads are mostly about getting DMD to predefine Posix or Unix.  That's
not what this bug is about.  This is about the capitalization of "Linux" being
inconsistent, and that's it.

The second thread does include this rationale for "version(linux)" from Walter:

"""
The reason DMD uses "linux" is because gcc under Linux predefines "linux". 
"""
http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=D.gnu&artnum=1240

I have no idea why DMD should define its Linux version identifier based on
GCC's behavior, rather than doing something consistent and which makes sense
for D.  But even if for some bizarre reason people feel that D's versions
should follow the conventions of #defines established by some particular
implementations of C, there's still an inconsistency, because the preprocessor
symbol predefined on Windows systems is not "Windows" or "Win32", but rather
"WINDOWS" or "WIN32" or "_WIN32".


-- 



More information about the Digitalmars-d-bugs mailing list