From: utzoo!decvax!harpo!ihps3!ixn5c!inuxc!inuxd!stevens
Newsgroups: net.unix-wizards
Title: Re: if statement ambiguity
Article-I.D.: inuxd.161
Posted: Thu Sep 23 13:09:42 1982
Received: Mon Sep 27 20:37:53 1982

The trick I use is to define the macro like this:
	#define mymacro		if (e1) s1; else
-or-
	#define mymacro		if (e1) {s1;} else
Then both
	mymacro;
-and-
	if (whatever)
		mymacro;
	else
		stmt;
work like you would expect.
This also works for things like:
	#define TRACE(stmt)	if (tracing) {stmt;} else
so you can do
	TRACE(printf("Got to this point.\n"));

--Scott Stevens
inuxd!stevens