> > >Is there any nice (i.e. predefined) macro that I can use to detect
> > >the compiler being used (like #ifdef _GNU)?
> >
> > gcc uses __GNUC__. I don't know if there is a unique macro for HP/C.
>
> HP C/iX defines __hp3000s900
Ooops! gcc also defines __hp3000s900. Here are the standard defines
automatically set by gcc:
-D__GNUC__=2 -D__GNUC_MINOR__=7 -Dhppa -Dhp3000s900 -D__hp3000s900
-Dhp3k9 -DPWB -Dmpeix -D_POSIX_SOURCE -D__hppa__ -D__hp3k9__ -D__PWB__
-D__mpeix__ -D__hppa -D__hp3000s900 -D__hp3k9 -D__PWB -D__mpeix
Oh, and while I'm at it, gcc uses the following search hierarchy to
resolve include files:
GNU CPP version 2.7.2.2 (hppa)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/hppa1.0-hp-mpeix/include
/usr/local/lib/gcc-lib/hppa1.0-hp-mpeix/2.7.2/include
/usr/include
>Both noted and now appearing in the FAQ, section 6.12.5. "Porting Tips for
>POSIX applications".
-Chris Bartram