diff options
| author | grischka <grischka> | 2009-07-18 22:06:37 +0200 |
|---|---|---|
| committer | grischka <grischka> | 2009-07-18 22:06:37 +0200 |
| commit | dc251a7d8d8bb4fb57773790152bfe85236f5f12 (patch) | |
| tree | e8dcec8579afbe341a4af7560f0a7e559238f503 /include/stdarg.h | |
| parent | 06aed3d171839454648cebd0c58eaf4667e4979a (diff) | |
| download | tinycc-dc251a7d8d8bb4fb57773790152bfe85236f5f12.tar.gz tinycc-dc251a7d8d8bb4fb57773790152bfe85236f5f12.tar.bz2 | |
win64: use new headers from mingw
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 */ |
