update comment.
[ruby-svn.git] / wince / varargs.h
blob2d1d476ccd9d794fe57ac8db9223f5af9647e93c
2 #ifndef VARARGS_H
3 #define VARARGS_H 1
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
9 #ifndef _VA_LIST_DEFINED
10 typedef char *va_list;
11 #define _VA_LIST_DEFINED
12 #endif
14 //#ifdef MIPS
15 #define va_alist __va_alist, __va_alist2, __va_alist3, __va_alist4
16 #define va_dcl int __va_alist, __va_alist2, __va_alist3, __va_alist4;
17 #define va_start(list) list = (char *) &__va_alist
18 #define va_end(list)
19 #define va_arg(list, mode) ((mode *)(list =\
20 (char *) ((((int)list + (__builtin_alignof(mode)<=4?3:7)) &\
21 (__builtin_alignof(mode)<=4?-4:-8))+sizeof(mode))))[-1]
22 #else
23 #define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) )
24 #define va_dcl va_list va_alist;
25 #define va_start(ap) ap = (va_list)&va_alist
26 #define va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) )
27 #define va_end(ap) ap = (va_list)0
28 //#endif
30 #ifdef __cplusplus
32 #endif
34 #endif