/* Amount of space required in an argument list for an arg of type TYPE.
TYPE may alternatively be an expression whose type is used. */ #define __va_rounded_size(TYPE) \ (((sizeof(TYPE)+sizeof(int)- 1)/sizeof(int))*sizeof(int))
/* AP指向可变参数 */ #defineva_start(AP, LASTARG) \ (AP =((char*)&(LASTARG)+ __va_rounded_size (LASTARG)))
voidva_end(va_list AP) {
AP = 0; } #defineva_end(AP)
/* AP 指向下一个参数, 然后给出当前参数的地址 */ #defineva_arg(AP, TYPE) \ (AP += __va_rounded_size (TYPE), \ *((TYPE *)(AP - __va_rounded_size (TYPE))))