Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!umnd-cs!umn-cs!herndon From: herndon@umn-cs.UUCP (Robert Herndon) Newsgroups: comp.lang.c Subject: Re: cpp macro expansion Message-ID: <1494@umn-cs.UUCP> Date: Fri, 17-Apr-87 14:26:51 EST Article-I.D.: umn-cs.1494 Posted: Fri Apr 17 14:26:51 1987 Date-Received: Sun, 19-Apr-87 13:06:04 EST Organization: University of Minnesota, Minneapolis Lines: 17 Summary: #define CONCAT In article <2857@linus.UUCP>, ms@security.uucp (Mistress Account) writes: > #define MACRO(first,last) (\ > first\ > _\ > last) > The intent of the developers was that when cpp expands the code, the two > macro arguments would be concatenated together into one token for the > compiler, i.e: MACRO(holy,cow) yields (holy_cow). Try: #define CONCAT(first,last) first/**/_/**/last I think this has worked for me on various suns -- the preprocessor does the expansion, stripping out the comments in the definition, leaving no spaces. Robert Herndon