Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.unix-wizards,net.lang.c Subject: Re: #define kinda stuff Message-ID: <6583@utzoo.UUCP> Date: Fri, 11-Apr-86 14:00:32 EST Article-I.D.: utzoo.6583 Posted: Fri Apr 11 14:00:32 1986 Date-Received: Fri, 11-Apr-86 14:00:32 EST References: <1458@cwruecmp.UUCP> Organization: U of Toronto Zoology Lines: 23 > Here's what I wanna do: > > #define (-: /* > #define :-) */ > > Obviously I want to make (-: and :-) my comment delimiters. One problem, > though, is that the compiler or preprocessor (or whatever it is that does it) > interprets most of the above as a comment containing '\n#define :-)'. How > do I get around this??? ... You won't like the answer: you can't. Not portably, anyway. Comment processing is done before #define processing in most compilers. You might be able to find a compiler which would do what you want, but C compilers in general won't. The X3J11 drafts are quite explicit that comment stripping precedes #define processing, so the situation is not going to get better. To reiterate something that has been said before: the C preprocessor is not intended as a general-purpose macro processor. -- Support the International League For The Derision Of User-Friendliness! Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,decvax,pyramid}!utzoo!henry