Annotation of gcc/va-spur.h, revision 1.1.1.4

1.1       root        1: /*  varargs.h for SPUR */
                      2: 
                      3: /* NB.  This is NOT the definition needed for the new ANSI proposed
                      4:    standard */
                      5:  
                      6: 
1.1.1.4 ! root        7: struct __va_struct { char __regs[20]; };
1.1       root        8: 
1.1.1.3   root        9: #define va_alist __va_regs, __va_stack
1.1       root       10: 
1.1.1.3   root       11: #define va_dcl struct __va_struct __va_regs; int __va_stack;
1.1       root       12: 
1.1.1.2   root       13: typedef struct {
1.1.1.4 ! root       14:     int __pnt;
        !            15:     char *__regs;
        !            16:     char *__stack;
1.1.1.2   root       17: } va_list;
1.1       root       18: 
1.1.1.2   root       19: #define va_start(pvar) \
1.1.1.4 ! root       20:      ((pvar).__pnt = 0, (pvar).__regs = __va_regs.__regs, \
        !            21:       (pvar).__stack = (char *) &__va_stack)
1.1.1.2   root       22: #define va_end(pvar)
1.1       root       23: 
                     24: #define va_arg(pvar,type)  \
1.1.1.3   root       25:     ({  type __va_result; \
1.1.1.4 ! root       26:         if ((pvar).__pnt >= 20) { \
        !            27:            __va_result = *( (type *) ((pvar).__stack + (pvar).__pnt - 20)); \
        !            28:           (pvar).__pnt += (sizeof(type) + 7) & ~7; \
1.1       root       29:        } \
1.1.1.4 ! root       30:        else if ((pvar).__pnt + sizeof(type) > 20) { \
        !            31:           __va_result = * (type *) (pvar).__stack; \
        !            32:           (pvar).__pnt = 20 + ( (sizeof(type) + 7) & ~7); \
1.1       root       33:        } \
                     34:        else if (sizeof(type) == 8) { \
1.1.1.3   root       35:           union {double d; int i[2];} __u; \
1.1.1.4 ! root       36:           __u.i[0] = *(int *) ((pvar).__regs + (pvar).__pnt); \
        !            37:           __u.i[1] = *(int *) ((pvar).__regs + (pvar).__pnt + 4); \
1.1.1.3   root       38:           __va_result = * (type *) &__u; \
1.1.1.4 ! root       39:           (pvar).__pnt += 8; \
1.1       root       40:        } \
                     41:        else { \
1.1.1.4 ! root       42:           __va_result = * (type *) ((pvar).__regs + (pvar).__pnt); \
        !            43:           (pvar).__pnt += (sizeof(type) + 3) & ~3; \
1.1       root       44:        } \
1.1.1.3   root       45:        __va_result; })

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.