rchrd@well.UUCP (Richard Friedman) (05/23/89)
I recently discovered that contrary to what the new C manual
for 10.1 says on page 4-103, the compiler totally ignores the
file /usr/include/apollo_$std.h
In particular, the preprocessor symbols
apollo
and aegis
are defined for every routine compiled with /bin/cc compiler.
For example, the file:
#include <stdio.h>
main()
{
#ifdef aegis
printf(" aegis defined\n");
#endif
#ifdef apollo
printf(" apollo defined\n");
#endif
}
prints both lines with /usr/include/apollo_$std.h deleted.
It also prints both lines with apollo_$std.h containing the following:
#undef aegis
#undef apollo
Does anyone know whats going on here, and how I can prevent the compiler
from defining aegis and apollo short of having to undef them in every
routine. (This problem arises when trying to compiler KERMIT on 10.1
BSD. It has conditional code for apollo/aegis (assuming pre 10.1 systems))
(whimper whimper!)
--
...Richard Friedman rchrd@well.uucp
(Pacific-Sierra Research/Berkeley, CA.)
also: {lll-crg,pacbell,hplabs}!well!rchrd
rchrd@well.UUCP (Richard Friedman) (05/23/89)
As soon as I wrote the original note about the preprocessor symbols aegis and apollo always being defined with the C compiler /bin/cc, I realized that I should try the -U option on the cc command. That worked. I now have KERMIT working on 10.1 I will report on KERMIT in another note targeted at KERMIT. As far as cc is concerned: 1) I dont think /usr/include/apollo_$std.h is being read automatically by /bin/cc as described by the manual. (I'll check it again.) 2) The symbols apollo and aegis are predefined by /bin/cc (perhaps cc is wired that way but I couldnt find any text file other than apollo_$std.h that defines them.) 3) The symbol apollo should not be undefined because many of the standard texts (stdio.h, etc.) are conditional on "apollo" and will not compile if it isnt defined. 4) To undefine aegis (which you might want to do on BSD for programs written to run on aegis or std BSD), you must have -Uaegis on the cc command line. Now go see my note on KERMIT. (Are we having fun yet. I hope my boss never gets to see how much time I've wasted getting all this going! And it was my idea to upgrade to 10.1 ! ) -- ...Richard Friedman rchrd@well.uucp (Pacific-Sierra Research/Berkeley, CA.) also: {lll-crg,pacbell,hplabs}!well!rchrd