[Gllug] Website developement

Nix nix at esperi.demon.co.uk
Sun Jul 15 22:51:06 UTC 2001


On 15 Jul 2001, Stig Brautaset stipulated:
> You can represent every character you want using this method. If you
> have a macro defined, and you want to have a comma in text used for
> input to this macro then you will have to use , or the equivalent
> (lest gcc -P complains about "too many arguments too macro" or
> something along those lines)

You can use a GCC extension and say

#define MACRO_WITH_COMMAS(args...)

to let `args' be everything in the macro, including commas, spaces, and
Cthulhu knows what else. (Note that multiple spaces may be collapsed to
one in the process.)

(You can have arguments before `args', of course, and they're treated in
the normal way for macros.)

(C99 has standardized another way of doing macro varargs, which is
subtly different; but for this application the differences don't
matter. Also, since only GCC-3.0's integrated preprocessor knows about
the C99 definition and `cpp -traditional' does not use this
preprocessor, `cpp -traditional' will never understand it, in any
version of GCC.)

-- 
`I'm not sure whether libtool is an existence proof that you _can_
 write a shell script that handles its arguments correctly, or a
 demonstration that you may try but you are doomed to failure.'
                                                       -- Zack Weinberg


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list