[Issue 2021] version(linux) is inconsistent

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 21 15:49:54 PDT 2008


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





------- Comment #2 from afb at algonet.se  2008-04-21 17:49 -------
(In reply to comment #1)
> Also, uname gives Linux, which tends to be the source used for scripted and
> programmed checks for the OS. uname on FreeBSD returns freebsd for instance,
> which turns out to also be the version identifier for that OS in GDC.

No, the uname on FreeBSD returns "FreeBSD" and the uname on Mac OS X returns
"Darwin". The version identifiers are lower-cased for all of the systems, with
the common pre-defined definition in GDC being version(Unix) which matches
version(Windows). Unfortunately, DMD is missing "Unix" and only has "linux".

See http://www.prowiki.org/wiki4d/wiki.cgi?DocComments/Version

> This would allow for things like
> 
> ./gdc -fversion=`uname`

Why would you need this ? It's built-in anyway... But it's used for Makefile
inclusions in wxD, for instance. So it comes in handy once in a while. The
definitions for MinGW and Cygwin are rather ugly, though. (includes version and
is upper-case, looks something like "MINGW32_NT-5.1" or "CYGWIN_NT-5.1")


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.


-- 



More information about the Digitalmars-d-bugs mailing list