#define kinda stuff

Henry Spencer henry at utzoo.UUCP
Sat Apr 12 05:00:32 AEST 1986


>     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



More information about the Comp.unix.wizards mailing list