diff options
Diffstat (limited to 'include/stdarg.h')
| -rw-r--r-- | include/stdarg.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/stdarg.h b/include/stdarg.h index 86e556c..b5844d0 100644 --- a/include/stdarg.h +++ b/include/stdarg.h @@ -2,6 +2,7 @@ #define _STDARG_H #ifdef __x86_64__ +#ifndef _WIN64 #include <stdlib.h> /* GCC compatible definition of va_list. */ @@ -48,16 +49,21 @@ typedef struct __va_list_struct *va_list; *(dest) = *(src)) #define va_end(ap) __builtin_free(ap) -#else - +#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_end(ap) +#endif +#else /* __i386__ */ +typedef char *va_list; /* only correct for i386 */ #define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3) #define va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3))) #define va_copy(dest, src) (dest) = (src) #define va_end(ap) - #endif /* fix a buggy dependency on GCC in libio.h */ |
