Xref: utzoo comp.lang.c:22650 comp.unix.questions:16871 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!eru!luth!sunic!mcsun!hp4nl!ruuinf!piet From: piet@cs.ruu.nl (Piet van Oostrum) Newsgroups: comp.lang.c,comp.unix.questions Subject: Re: preprocessor question (non-ANSI) Keywords: #define C ANSI Message-ID: <1679@ruuinf.cs.ruu.nl> Date: 10 Oct 89 09:25:12 GMT References: <174@eliza.edvvie.at> Sender: news@ruuinf.cs.ruu.nl Reply-To: piet@cs.ruu.nl (Piet van Oostrum) Followup-To: comp.lang.c Organization: Dept of Computer Science, University of Utrecht, Holland Lines: 19 In-reply-to: johnny@edvvie.at (Johann Schweigl) In article <174@eliza.edvvie.at>, johnny@edvvie (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 If your preprocessor is non-ANSI, you might try: #define EXEC __curline = __LINE__; EX/**/EC or something similar. Note that this is very unportable. -- Piet van Oostrum, Dept of Computer Science, University of Utrecht Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands. Telephone: +31-30-531806 Internet: piet@cs.ruu.nl Telefax: +31-30-513791 Uucp: uunet!mcsun!hp4nl!ruuinf!piet