Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!lll-winken!uunet!portal!cup.portal.com!jwhitnell From: jwhitnell@cup.portal.com (Jerry D Whitnell) Newsgroups: comp.sys.mac.programmer Subject: Re: ?Bug? in LsC Preprocessor. Message-ID: <16382@cup.portal.com> Date: 29 Mar 89 05:35:43 GMT References: <11796@umn-cs.CS.UMN.EDU> Distribution: usa Organization: The Portal System (TM) Lines: 26 |I'm having a problem with a macro in LsC. The following macro is preprocessed |"correctly" with the Sun and Sequent C preprocessors but in LsC I get |just a syntax error. | |#define check_size(name) \ | if (e_/**/name >= l_/**/name) { \ | etc. What you see is a kludge based on the design of the UNIX C preprocessor. LSC supports the ANSI C ##, which concatenates two tokens together. So try the following: #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; \ } | |Kenny Goers |goers@umn-cs.cs.umn.edu Jerry Whitnell jwhitnel@cup.portal.com