Why version() ?
Anders F Björklund
afb at algonet.se
Sat Feb 14 12:15:18 PST 2009
Yigal Chripun wrote:
> I'm no Mac user but it seems to me that OS X is a superset of darwin
> (i.e darwin plus apple's proprietery APIs like cocoa, carbon).
> if that's true isn't it more acurate to have version darwin for the
> darwin OS (someone mentioned opendarwin), and osx version for Apple's
> Mac OS X in addition to darwin version? i.e Mac OS X is both "osx" and
> "darwin" whereas opendarwin is only "darwin".
> does that make sense?
Sortof, just that OpenDarwin/PureDarwin are normally "puredarwin"
while Mac OS X is "macosx" - both in addition to regular "darwin".
At least those are the "variants" that DarwinPorts/MacPorts uses,
Apple recommends to check for specific functionality (Carbon/Cocoa)
using something like autoconf and not assume things from the OS name.
But D could still do user-level versions of those features, though ?
In MacPorts, the toggle for +puredarwin/+macosx is a simple Tcl check:
[file isdirectory /System/Library/Frameworks/Carbon.framework]
But yeah, it would be nice if DMD could set *both* "version(darwin)"
and "version(OSX)" for Mac OS X. That way the old code would work too.
There would still be some library issues between Phobos and gPhobos,
like std.c.osx.osx verus std.c.unix.unix, but that's another story...
--anders
More information about the Digitalmars-d
mailing list