/* GCT - Removed ident line. */ /* $Header: /usr/export/home/marick/RCS/gvarargs.h,v 1.4 1993/01/28 16:51:35 marick Exp $ */ /* $Log: gvarargs.h,v $ * Revision 1.4 1993/01/28 16:51:35 marick * Changes for IBM 370 architecture running AIX. * * Revision 1.3 1992/08/30 20:18:44 marick * Bull DPX/2 changes (from Bull) * */ /* This file contains changes made by Data General, December 1989. */ #ifndef __GNUC__ /* Use the system's macros with the system's compiler. */ #include #else /* the GNU side... */ #ifdef __sparc__ #include "va-sparc.h" #else #ifdef __spur__ #include "va-spur.h" #else #ifdef __mips__ #include "va-mips.h" #else #ifdef __i860__ #include "va-i860.h" #else #ifdef __pyr__ #include "va-pyr.h" #else #ifdef __m88k__ #include "va-m88k.h" #else #ifdef __NeXT__ /* On Next, erase any vestiges of stdarg.h. */ #undef va_alist #undef va_dcl #undef va_list #undef va_start #undef va_end #undef __va_rounded_size #undef va_arg /* Record that varargs.h is defined; this turns off stdarg.h. */ #ifndef _VARARGS_H #define _VARARGS_H #endif #endif /* __NeXT__ */ /* These macros implement traditional (non-ANSI) varargs for GNU C. */ #define va_alist __builtin_va_alist #define va_dcl int __builtin_va_alist; /* RBE 27-nov-90: csb3 stdio.h wants to define this, so we need to * protect it appropriately. */ #ifdef m370 /* BEM - What follows is SSI's change to this file, followed in the #else by the original code. I haven't simplified the change because I wonder if it's necessary and want to make it easy to undo. */ #ifndef _VA_LIST_T_ #define _VA_LIST_T_ typedef void *va_list; #endif #else #if !defined(_VA_LIST_T_) && !defined(_VA_LIST_T_H) #define _VA_LIST_T_ typedef void *va_list; #endif #endif #ifdef __sparc__ #define va_start(AP) \ (__builtin_saveregs (), \ AP = ((void *) &__builtin_va_alist)) #else #define va_start(AP) AP=(char *) &__builtin_va_alist #endif #define va_end(AP) #define __va_rounded_size(TYPE) \ (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) #if 1 /* version that works for big-endian machines like the 68k */ #define va_arg(AP, TYPE) \ (AP += __va_rounded_size (TYPE), \ *((TYPE *) (AP - sizeof (TYPE)))) #else /* va_arg based on big/little endian */ /* version that works for little-endian machines like the vax */ #define va_arg(AP, TYPE) \ (AP += __va_rounded_size (TYPE), \ *((TYPE *) (AP - __va_rounded_size (TYPE)))) #endif /* va_arg based on big/little endian */ #endif /* not m88k */ #endif /* not pyr */ #endif /* not i860 */ #endif /* not mips */ #endif /* not spur */ #endif /* not sparc */ #endif /* __GNUC__ */ #ifdef m370 typedef char *va_list; /* "void" conflicts with the native typedef... . */ #define va_alist __builtin_va_alist #define va_dcl int __builtin_va_alist; #define va_start(AP) AP=(char *) &__builtin_va_alist #define va_arg(AP, _var) (*(_var *) ((AP += (sizeof(_var) +3) &(-4)) - ((sizeof( _var) < 4) ? sizeof(_var) : (sizeof(_var) + 3) &(-4)))) #define va_end(AP) #endif /* if m370 */