It seems I often spend way too much time trying to get a #define macro to do exactly what i want. I\'ll post my current dilemma below and any help is appreciated. But really
You appear to be confused about what the exact syntax is for stringifying or token pasting in C preprocessor macros.
You might find this page about C preprocessor macros in general helpful.
In particular, I think this macro should read like this:
#define GETADDR_FOR(a) if (!(a = (_##a)GetProcAddress(h, #a))) --iFail
The trailing ;
should be skipped because you will likely be typing this as GETADDR_FOR(hexdump);
, and if you don't it will look very strange in your C code and confuse many syntax highlighters.
And as someone else mentioned gcc -E
will run the preprocessor and skip the other compilation steps. This is useful for debugging preprocessor problems.