andrew@cucumber.demon.co.uk (Andrew Gabriel) writes:
Quote:
I want to pick up the OS release during compilation in order to
make up for something which is missing from a header file in a
certain release. The Sun C compiler provides a built in predefinition
>
__`uname -s`_`uname -r`
>
and as an example, echo __`uname -s`_`uname -r` gives:
>
__SunOS_5.10
No, the Sun C compiler doesn't provide this particular predefined
symbol. It couldn't, since such a symbol is illegal.
<OT>
"cc -### nosuchfile.c" will show you which symbols are predefined.
One of those symbols is "__SunOS_5_10", which is a legal identifier.
</OT>
Note that identifiers starting with "__" are reserved to the
implementation. Here, it's being defined by the implementation, which
is perfectly correct. If you tried to define such an identifier
yourself, you'd be infringing on the implementation's namespace, with
potentially dangerous consequences.
If you have questions about C, this is the right place. If you have
questions about the behavior of Sun's C compiler, you'll get better
help in comp.unix.solaris.
--
Keith Thompson (The_Other_Keith)
kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"