Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!umich!eecs.umich.edu!spencer From: spencer@eecs.umich.edu (Spencer W. Thomas) Newsgroups: comp.sys.mac.programmer Subject: Re: ?Bug? in LsC Preprocessor. Message-ID: Date: 28 Mar 89 15:47:29 GMT References: : <11796@umn-cs.CS.UMN.EDU> Sender: news@zippy.eecs.umich.edu Distribution: usa Organization: University of Michigan EECS Dept Lines: 19 In-reply-to: goers@julius.cs.umn.edu's message of 27 Mar 89 23:25:13 GMT This is the sort of thing that is not guaranteed to work across C preprocessors. It works in pcc based compilers. ANSI C has a standard for "token concatenation" (which is what you are trying to do) using ##. Thus, your example would be #define check_size(name) \ if (e_##name >= l_##name) { \ register nsize = l_##name-s_##name+400; \ name##buf = (char *) realloc(name##buf, nsize); \ e_##name = name##buf + (e_##name-s_##name) + 1; \ l_##name = name##buf + nsize - 5; \ s_##name = name##buf + 1; \ } You might try this and see if LSC hacks it. (I think LSC 3.0 is supposed to be ANSI-compliant, so it should.) Otherwise, you are out of luck. =Spencer (spencer@eecs.umich.edu)