Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!gatech!hao!ames!hc!hi!bret From: bret@hi.UUCP (Bret K. Thaeler) Newsgroups: comp.unix.wizards,comp.unix.questions,comp.lang.c Subject: Re: need cpp macros to concatenate names Message-ID: <6205@hi.UUCP> Date: Wed, 6-May-87 05:47:25 EDT Article-I.D.: hi.6205 Posted: Wed May 6 05:47:25 1987 Date-Received: Sat, 9-May-87 00:36:16 EDT References: <634@calma.UUCP> Distribution: na Organization: U. of New Mexico, Albuquerque Lines: 69 Summary: Possible Solution Xref: mnetor comp.unix.wizards:2180 comp.unix.questions:2170 comp.lang.c:2082 > #define prefix my > > #define concat(x,y) x\ > y > > main() > { > long *concat(prefix,file); > } > This is our attempt. This was done on a Sun running 3.3. #define pre()my #define prefix pre() #define concat(x,y)x//**/**/y main() { long *concat(prefix,file); } ----------------- producing ----------------- main() { long *myfile; } ============================================= Now for the hard one.... What if you want BOTH of the concat() args to be #define's??? #define prefix my #define post()file #define postfix post() #define concat(x,y)x//**/**/y main() { long *concat(prefix,postfix); } ----------------- producing ----------------- main() { long *myfile; } ============================================= Brought to you by the minds of ... --Bret Who said hackers were no good bums? --Josh Who needs m4? --Kurt -- -------------------------------------------------------------------------------- Bret K. Thaeler ARPA: thaeler@hc.dspo.gov | /// Amiga College of Enginering, UNM UUCP: hc!thaeler | /// user Professional Student | \\\ /// Of: (505) 277-1611 Ho: (505) 277-4497 | \\\/// And dam I instinctively used the Vulcan death grip. | \/// proud, ofak