Xref: utzoo comp.lang.c:22674 comp.unix.questions:16882 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!ginosko!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!rutgers!att!cbnewsl!dfp From: dfp@cbnewsl.ATT.COM (david.f.prosser) Newsgroups: comp.lang.c,comp.unix.questions Subject: Re: preprocessor question (non-ANSI) Keywords: #define C ANSI Message-ID: <2196@cbnewsl.ATT.COM> Date: 10 Oct 89 15:03:42 GMT References: <174@eliza.edvvie.at> Reply-To: dfp@cbnewsl.ATT.COM (david.f.prosser) Organization: AT&T Bell Laboratories Lines: 14 In article <174@eliza.edvvie.at> johnny@edvvie.at (Johann Schweigl) writes: >How can I replace a text token by itself, along with some additional text? >Example: >EXEC SQL select * from emp; __curline = 23; EXEC SQL select * from emp; >before ^^^^^^^^^^^^^^^^^^^^ after ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >#define EXEC __curline = __LINE__; EXEC >is not the solution, cpp would try to resolve EXEC recursively >I know, sed is the most natural solution, but I want to do all by including >a single file. ANSI is not spoken on my system. With ANSI C, your example macro definition will work as you desire. Dave Prosser ...not an official X3J11 answer...