How to understand this macro definition?

I study the Dalvik VM code, but dwell on some strange C define macros in the InterpC-portable.cpp file. They are hard to understand for me. Code:

# define H(_op) &&op_##_op 

and in the file libdex / DexOpcodes.h it is used as follows:

 #define DEFINE_GOTO_TABLE(_name) \ static const void* _name[kNumPackedOpcodes] = { \ /* BEGIN(libdex-goto-table); GENERATED AUTOMATICALLY BY opcode-gen */ \ H(OP_NOP), \ H(OP_MOVE), \ H(OP_MOVE_FROM16), \ ... 

OP_NOP, OP_MOVE, OP_MOVE_FROM16 is an enum variable. But what is the meaning of && work in the H (_op) macro? It makes no sense to get a pointer pointer that is not stored in memory. Can anybody help me? Thanks.

+4
source share
1 answer

&& is the label operator. It returns its addres label defined in the current area used as the operand. This is the gcc extension.

+7
source

Source: https://habr.com/ru/post/1446012/


All Articles