www.digitalmars.com         C & C++   DMDScript  

D - Unix version identifiers

reply Barry Pederson <bp barryp.org> writes:
I've been fooling around with getting DLI to compile and run under FreeBSD, 
and have had some minor success in getting a simple "hello world" type 
program to compile and run.

One thing I noticed was the use of the version identifiers "linux" and 
"Linux" in the Phobos library to identify non-Win32 code.  That seems a bit 
shortsighted to assume Linux is the only other platform D will run on.

I'd suggest perhaps defining (in the D specs) "POSIX" to be the standard 
version identifier for code that applies to that family of platforms, which 
would include Linux, Free/Net/OpenBSD, Cygwin, MacOSX and so on.

A Linux compiler could still enable the "Linux" version identifier in 
addition to "POSIX", in case you needed to get at Linux-specific bits of 
code.  Presumably FreeBSD would enable ["FreeBSD", "POSIX"] for versions, 
Cygwin would do ["Cygwin", "POSIX"] .....

I think this would be worth deciding on sooner rather than later - before 
the habit of using "Linux" for non-Linux specific things gets too ingrained.

	Barry
Nov 04 2002
next sibling parent Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
Perhaps the ability to "import a version" (sort of like superclassing):

version(linux) {
    import version(posix);
}

--
The Villagers are Online! http://villagersonline.com

.[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ]
.[ (a version.of(English).(precise.more)) is(possible) ]
?[ you want.to(help(develop(it))) ]
Nov 04 2002
prev sibling parent Karim Sharif <Karim_member pathlink.com> writes:
I couldn't agree more (even though I prefer Linux :-).
In general it's the POSIX standard that these OS's are
associated with that make the system software and 
languages on them so portable in the first place.

So, in my opinion, kernel specific stuff belongs as 
sort of a 'sub' version of the standard, POSIX.Linux
vs. Linux.POSIX...

Karim


In article <aq74cf$g81$1 digitaldaemon.com>, Barry Pederson says...
I've been fooling around with getting DLI to compile and run under FreeBSD, 
and have had some minor success in getting a simple "hello world" type 
program to compile and run.

One thing I noticed was the use of the version identifiers "linux" and 
"Linux" in the Phobos library to identify non-Win32 code.  That seems a bit 
shortsighted to assume Linux is the only other platform D will run on.

I'd suggest perhaps defining (in the D specs) "POSIX" to be the standard 
version identifier for code that applies to that family of platforms, which 
would include Linux, Free/Net/OpenBSD, Cygwin, MacOSX and so on.

A Linux compiler could still enable the "Linux" version identifier in 
addition to "POSIX", in case you needed to get at Linux-specific bits of 
code.  Presumably FreeBSD would enable ["FreeBSD", "POSIX"] for versions, 
Cygwin would do ["Cygwin", "POSIX"] .....

I think this would be worth deciding on sooner rather than later - before 
the habit of using "Linux" for non-Linux specific things gets too ingrained.

	Barry
Nov 05 2002