Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!ericom!eos.ericsson.se!epames From: epames@eos.ericsson.se (Michael Salmon) Newsgroups: comp.binaries.ibm.pc.d Subject: Re: Q: MSC & Macro substitutions Message-ID: <1990Dec7.132824.11652@ericsson.se> Date: 7 Dec 90 13:28:24 GMT References: <1197@dg.dg.com> Sender: news@ericsson.se Reply-To: epames@eos.ericsson.se Organization: Ericsson Telecom AB Lines: 31 In article <1197@dg.dg.com> Bruce Kahn writes: > >#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; \ > } > > > and then elsewhere in the main program it does a call like: > > check_size (code); > >where there are variables named e_code, l_code, codebuf and s_code already >declared. What would be the equivalent MSC 5.1 code to do this? I tried to >remove the offending /**/ but then I get a compile error w/e_name, etc... > > Any suggestions (apart from hard code it)?? > As you worked out the intention was to concatenate a string literal with a variable. ANSI compilers have a more portable way of doing it, if memory serves me correctly it is ##. Check the manual it will give you the details. I believe that it is called stringizing. I hope that this is of help. Michael Salmon L.M.Ericsson Stockholm