Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!husc6!think!ames!hc!hi!kurt From: kurt@hi.UUCP (Kurt Zeilenga) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: need cpp macros to concatenate names Message-ID: <6132@hi.UUCP> Date: Tue, 5-May-87 05:57:08 EDT Article-I.D.: hi.6132 Posted: Tue May 5 05:57:08 1987 Date-Received: Wed, 6-May-87 05:14:34 EDT References: <634@calma.UUCP> <18010@sun.uucp> Reply-To: kurt@hi.UUCP (Kurt Zeilenga) Distribution: na Organization: U. of New Mexico, Albuquerque Lines: 32 Xref: mnetor comp.unix.wizards:2153 comp.unix.questions:2145 In article <18010@sun.uucp> guy%gorodish@Sun.COM (Guy Harris) writes: . . . >The following trick works on the versions of the "Reiser" preprocessor >that are distributed with AT&T UNIX releases, but somebody may have >changed things so as to make it not work (unlikely - I know of nobody >who has - but not impossible): > > #define concat(x,y) x/**/y > >Note, BTW, that you MUST NOT call "concat" as > > concat(foo, bar) > >and expect it to glue "foo" and "bar" together - it will glue "foo" >and " bar" (note the blank) together. It don't work that way on BSD releases. The comment gets stripped before either foo or bar get replaced by any other macros. Hence: #define foo kay #define bar o #define concat(x,y) x/**/y concat(foo,bar) Returns: " foobar" (as Guy noted, the space)... -- Kurt Zeilenga (zeilenga@hc.dspo.gov) I want my talk.flame! "So long, Mom, I'm off to drop the bomb..."