#if foo vs #if defined(foo)

G.R.Tomasevich grt at twitch.UUCP
Wed Jun 25 22:22:56 AEST 1986


Our compiler does not need a defined(), or at least I did not try whether
it is even accepted.  The following example works fine:

#if squat||foo
int yes;
#else
int no;
#endif
main() {}

if the 'cc' command includes either '-Dsquat' or '-Dfoo', then 'yes' is
selected, else 'no' is selected.  E.g.: 'cc -Dfoo -E c.c'
System: VAX-11/785 running UNIX 5.2
-- 
	George Tomasevich, ihnp4!twitch!grt
	AT&T Bell Laboratories, Holmdel, NJ



More information about the Comp.lang.c mailing list