home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
gnu
/
includ87.lzh
/
INCLUD87
/
STDARG.H
< prev
next >
Wrap
C/C++ Source or Header
|
1993-07-30
|
1KB
|
53 lines
/*
* STDARG.H
*/
#ifndef _STDARG_H
#ifndef va_start /* in case of varargs being included */
#define _STDARG_H
#ifndef _COMPILER_H
#include <compiler.h>
#endif
typedef __VA_LIST__ va_list;
#ifdef __GNUC__
/* Amount of space required in an argument list for an arg of type TYPE.
TYPE may alternatively be an expression whose type is used. */
#define __va_rounded_size(TYPE) \
(((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
#define va_start(AP, LASTARG) \
(AP = ((va_list) __builtin_next_arg ()))
#define va_end(AP)
/* We cast to void * and then to TYPE * because this avoids
a warning about increasing the alignment requirement. */
#define va_arg(AP, TYPE) \
(AP = (va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
(sizeof(TYPE)<=sizeof(int)? ((TYPE *) (AP))[-1] : \
*((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE)))))
#else
# ifdef __TURBOC__
# define va_start(list, param) ((list) = ...)
# define va_arg(list, type) (*((type *) (list))++)
# define va_end(list)
# else
# define va_start(list,param) list = ((va_list) &(param)) \
+ ((sizeof(param) + 1) & ~1)
# define va_arg(list,type) ((type *)(list += ((sizeof(type) + 1) & ~1)))[-1]
# define va_end(list)
# endif /* __TURBOC__ */
#endif /* __GNUC__ */
#endif /* va_start */
#endif /* _STDARG_H */