From dc251a7d8d8bb4fb57773790152bfe85236f5f12 Mon Sep 17 00:00:00 2001 From: grischka Date: Sat, 18 Jul 2009 22:06:37 +0200 Subject: win64: use new headers from mingw --- include/stdarg.h | 12 +++++++++--- include/varargs.h | 13 +++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) (limited to 'include') 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 /* 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 */ diff --git a/include/varargs.h b/include/varargs.h index daee29e..d614366 100644 --- a/include/varargs.h +++ b/include/varargs.h @@ -1,11 +1,12 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within this package. + */ #ifndef _VARARGS_H #define _VARARGS_H -#include - -#define va_dcl -#define va_alist __va_alist -#undef va_start -#define va_start(ap) ap = __builtin_varargs_start +#error "TinyCC no longer implements ." +#error "Revise your code to use ." #endif -- cgit v1.3.1