#include
const char *getOpcodeName(
uint8_t op
)
{
#define OPCODE(x, y) if((0x##y)==op) return "OP_" #x;
OPCODES
#undef O
Run your code thru a C++ preprocessor, e.g. using g++ -Wall -C -E opcodes.cpp > opcodes.i then look inside the generated opcodes.i
#define is not a statement but a preprocessor directive.
The macro OPCODES gets expanded to some big chunk, notably containing OPCODE( NOP, 61) which would get expanded to something like
if ((0x61)==op) return "OP_" "NOP";
The two string literals are concatenated into one, "OP_NOP" here.
GCC has a good documentation on its cpp preprocessor. Read about stringification (with the single # like the ending #x; of the OPCODE macro) and about concatenation (with a double ## like (0x##y) of the OPCODE macro).