You are not logged in.
I'm looking through the FFmpeg source code, and here's an example of what they're doing:
#define REGISTER_MUXER(X,x) { \
extern AVOutputFormat x##_muxer; \
if(CONFIG_##X##_MUXER) av_register_output_format(&x##_muxer); }
#define REGISTER_DEMUXER(X,x) { \
extern AVInputFormat x##_demuxer; \
if(CONFIG_##X##_DEMUXER) av_register_input_format(&x##_demuxer); }
#define REGISTER_MUXDEMUX(X,x) REGISTER_MUXER(X,x); REGISTER_DEMUXER(X,x)
#define REGISTER_PROTOCOL(X,x) { \
extern URLProtocol x##_protocol; \
if(CONFIG_##X##_PROTOCOL) av_register_protocol2(&x##_protocol, sizeof(x##_protocol)); }
x##_muxer, x##_demuxer, and x##_protocol don't look like they should be valid variable names. So why are they allowed here?
Offline
It's valid preprocessor. the ## operator does concatenation.
Offline