I've been trying to understand the va_arg macro source (compiler is Visual Studio 10, on 32-bit x86).
I have found source code on the net:
Code: Select all
#define va_arg(ap, t) (*(t *) ((ap += intsizeof(t)) - intsizeof(t)))
Can anyone help me to understand why this is?
For reference, this is the intsizeof macro:
Code: Select all
#define intsizeof(n) ((sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1))