From 5c35ba66c5ade4713bbd9c005e66889f6d7db293 Mon Sep 17 00:00:00 2001 From: James Lyon Date: Wed, 24 Apr 2013 02:19:15 +0100 Subject: 64-bit tests now pass (well, nearly). tcctest1-3 fail, but this appears to be due to bugs in GCC rather than TCC (from manual inspection of the output). --- include/stdarg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/stdarg.h b/include/stdarg.h index 666adf7..154030f 100644 --- a/include/stdarg.h +++ b/include/stdarg.h @@ -19,9 +19,9 @@ void __va_end(va_list ap); #else /* _WIN64 */ typedef char *va_list; -#define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+7)&~7) -#define va_arg(ap,type) (ap += (sizeof(type)+7)&~7, *(type *)(ap - ((sizeof(type)+7)&~7))) -#define va_copy(dest, src) (dest) = (src) +#define va_start(ap,last) __builtin_va_start(ap,last) +#define va_arg(ap,type) (ap += 8, sizeof(type)<=8 ? *(type*)ap : **(type**)ap) +#define va_copy(dest, src) ((dest) = (src)) #define va_end(ap) #endif -- cgit v1.3.1