Showing the changes to stdarg.h (1 of 1 file). Show all
Unified · Split
| @@ -4,9 +4,8 @@ · 3 unmodified lines | ||
| 4 | 4 | typedef char *va_list; |
| 5 | 5 | |
| 6 | 6 | /* only correct for i386 */ |
| 7 | −/* XXX: incorrect for type size different than 4 bytes*/ | |
| 8 | −#define va_start(ap,last) ap = ((char *)&(last)) + sizeof(int); | |
| 9 | −#define va_arg(ap,type) (ap += sizeof(int), *(type *)(ap - sizeof(int))) | |
| 7 | +#define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3) | |
| 8 | +#define va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3))) | |
| 10 | 9 | #define va_end(ap) |
| 11 | 10 | |
| 12 | 11 | /* fix a buggy dependency on GCC in libio.h */ |