When you include "tcg-op.h" inside enum the required content of "tcg-op.h" are copied inside enum.
There is no error in tcg-op.h, but when you include it inside enum, compiler is shocked what the int gen_new_label(void); is doing inside an enum and throw error.
It should work, if you do -
#include "tcg-op.h"
#define DEF(name, oargs, iargs, cargs, flags) INDEX_op_ ## name,
typedef enum {
DEF(ARG1, ARG2, ARG3, ARG4, ARG5)
NB_OPS,
} TCGOpcode;
#undef DEF