I need help doing the following:
a preprocessor macro label(x) shall output \"#x\", e.g.,
#define label(x) ...
if I call label(anam
You can do something like this:
#define f(x) x
#define label(a) f(#)a
I tested this by running it directly through cpp (the C preprocessor) instead of through gcc. Example:
cpp test > test.html
Using the cpp that is part of gcc version 4.0.1.
The only problem I noticed is that I get some extra unwanted output, namely the first 4 lines of the file are as follows:
# 1 "test"
# 1 ""
# 1 ""
# 1 "test"