David Collier-Brown -- Customer Engineering wrote:
I needed to get wins resolution added on Solaris to nsswitch specifically
for gethostbyname. The problem was that libnss_wins.so didn't include the
solaris wrapper and that libnss_winbind.so didn't include gethostbyname.
Here is a patch off of 2.2.7a that solves both issues (I'm not sure about
the #if SUN).
The predefined macros fron a Sun SC-series compilers are
__sun
__unix
__SUNPRO_C=0x500
__sparc (SPARC)
__sparcv9 (SPARC with -xarch=v9|v9a)
__i386 (x86)
__SVR4
Not that those are double leading underscores. From memory
and a quick check on linux, GCC defines a partially overlapping
set including __linux and __sun.
To get a full list of possibly-predefined symbols on
a particular installation of gcc, you can do something
like
tr ' ' '\012' < /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs | grep D | sed 's/.*-D//' | sort -u
but it's better to do autoconf-style feature tests than
#if operatingsystem
style tests, isn't it?
- Dan