pre#defines for system and machine

guy at gorodish.UUCP guy at gorodish.UUCP
Sat Jan 31 15:41:12 AEST 1987


>These extensions to CPP would allow any level of specification of the
>parentage of an operating system without having to resort to
>"_sys_unix_sysV_5_0_" or other such monstrosities.

That presumes you have some centralized registry of those names,
*and* that one name like that is adequate to categorize a system
*and* convenient to use.  OK, quick, what's a simple predicate
equivalent to "does this system have 4.2BSD-style sockets"?  Hint -
"release(bsd4_2)", or something like that, isn't it.  For one thing,
4.3BSD also has them; for another, plenty of systems that would
probably advertise themselves as System V also do.

The trouble here is that the question "is this System V", for
example, isn't very interesting.  "Is this system compliant with the
SVID" might be, except that this doesn't tell you whether it has
S5-style shared memory or not, since that's a kernel extension.
"Does this system have S5-style terminal 'ioctl's", or "does this
system call the 'search for a character within a string' function"
"index" or "strchr" are more likely to be interesting.

However, if most systems end up supporting the IEEE 1003.1 or SVID
interface and ANSI C, the more interesting questions will be 1) "does
this system support the minimal standard interface?" and 2-n) "does
this system support some particular extension?"

>P.S. Any other votes for adding "#elseif" to _cpp_??

No, but I'll certainly cast a very strong vote against it.  ANSI C
requires what is probably the same function (as I infer it from the
name), but calls it "#elif".  The S5R3 "cpp" already implements this.
Any trivial aesthetic advantage of spelling out "else" is vastly
outweighed by the effort involved in getting ANSI and the vendors
that have already implemented this (I suspect more vendors than AT&T
have), and the C programmers who have already used this, to go back
and change things.  (Yes, I know you can do both with a text editor;
the aesthetic advantage is *still* outweighed by the effort
involved.)



More information about the Comp.lang.c mailing list