Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!tut.cis.ohio-state.edu!unmvax!sandia!jgmicon From: jgmicon@sandia.UUCP (Jeff G. Micono ) Newsgroups: comp.lang.c Subject: Re: Using Macros Summary: This solution does work with an if/else combination Message-ID: <288@sandia.UUCP> Date: 7 Aug 90 20:48:47 GMT References: <14339@shlump.nac.dec.com> <10836@crdgw1.crd.ge.com> Organization: Sandia Natl Labs, Div. 9224 Lines: 25 In article <10836@crdgw1.crd.ge.com>, volpe@underdog.crd.ge.com (Christopher R Volpe) writes: > Anyway, if the compiler is coughing on it, try the following: > > #define A_MACRO {stmt1;stmt2;} 0 /* yes, trailing zero */ > > Expanding "A_MACRO;" yields the dummy statement "0;" which is ...ds your solution fails with the following: if (expr) A_MACRO; else printf ("This will not work!\n"); What about # define A_MACRO stmt1,stmt2 /* no flames, yes I know it's gross, but it works! */ Jeff Micono of Ktech Ktech Corporation, Albuquerque, NM 87801 "We provide ES&H solutions"