home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Club Elmshorn Atari PD
/
CCE_PD.iso
/
pc
/
0400
/
CCE_0423.ZIP
/
CCE_0423.PD
/
INCLUD83.ZOO
/
stdarg.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-07-20
|
948b
|
45 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;
#ifndef __GNUC__
#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)
#else
/* 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 = ((char *) &(LASTARG) + __va_rounded_size (LASTARG)))
#define va_end(AP)
#define va_arg(AP, TYPE) \
(AP += __va_rounded_size (TYPE), \
((TYPE *) AP)[-1])
#endif /* __GNUC__ */
#endif /* va_start */
#endif /* _STDARG_H */