Author: ludovicdludovicd
Date: Dec 25, 2006 07:45
Hi,
As many, I'm looking for a more efficient use of the C preprocessor.
The gcc manual specifies:
"The macro's body ends at the end of the `#define' line. You may
continue the definition onto multiple lines, if necessary, using
backslash-newline. When the macro is expanded, however, it will all
come out on one line. For example,
#define NUMBERS 1, \
2, \
3
int x[] = { NUMBERS };
==> int x[] = { 1, 2, 3 };
The most common visible consequence of this is surprising line numbers
in error messages.
There is no restriction on what can go in a macro body provided it
decomposes into valid preprocessing tokens. Parentheses need not
balance, and the body need not resemble valid C code. (If it does not,
you may get error messages from the C compiler when you use the macro.)
"
|