#if foo vs #if defined(foo)

jso at edison.UUCP jso at edison.UUCP
Tue Jul 8 03:20:58 AEST 1986


In article <379 at twitch.UUCP>, grt at twitch.UUCP ( G.R.Tomasevich) writes:
> #if squat||foo
> 
> if the 'cc' command includes either '-Dsquat' or '-Dfoo', then 'yes' is
> selected, else 'no' is selected.  E.g.: 'cc -Dfoo -E c.c'
> 	George Tomasevich, ihnp4!twitch!grt

Fine, since -Dfoo is the same as '#define foo 1', but what about
#define	foo
or
#define	foo	something

Do either of these work with
#if	squat||foo
?  I doubt it, since the #if is a *numeric* if.

	John Owens @ General Electric Company	(+1 804 978 5726)
	edison!jso%virginia at CSNet-Relay.ARPA		[old arpa]
	edison!jso at virginia.EDU				[w/ nameservers]
	jso at edison.UUCP					[w/ uucp domains]
	{cbosgd allegra ncsu xanth}!uvacs!edison!jso	[roll your own]



More information about the Comp.lang.c mailing list