|
|
1.1.1.2 ! root 1: #if __GNUC__ > 1 1.1 root 2: 1.1.1.2 ! root 3: typedef struct ! 4: { ! 5: char *__va_stack_start; /* Real start of stack args. */ ! 6: char *__va_int; /* Pointer to the general register */ ! 7: /* args and stack. */ ! 8: char *__va_float; /* Pointer to the fp register args. */ ! 9: char *__va_double; ! 10: } va_list; 1.1 root 11: 12: #ifdef _STDARG_H 1.1.1.2 ! root 13: #define va_start(AP,LASTARG) ((AP) = *(va_list *)__builtin_saveregs()) 1.1 root 14: #else 15: #define va_alist __builtin_va_alist 16: /* The ... causes current_function_varargs to be set in cc1. */ 17: #define va_dcl int __builtin_va_alist; ... 1.1.1.2 ! root 18: #define va_start(AP) ((AP) = *(va_list *)__builtin_saveregs()) 1.1 root 19: #endif /* _STDARG_H */ 20: 21: /* Handle pass by invisible reference and voids left by aligned */ 22: /* doubles. */ 23: 24: #define __va_rounded_size(TYPE) \ 25: (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) 26: 1.1.1.2 ! root 27: #define va_arg(AP, TYPE) \ ! 28: (((__va_rounded_size(TYPE) <= 8) \ ! 29: ? ((AP).__va_int -= __va_rounded_size (TYPE), \ ! 30: (AP).__va_float -= __va_rounded_size (TYPE), \ ! 31: (AP).__va_double -= __va_rounded_size (TYPE), \ ! 32: (__alignof__ (TYPE) > 4 ? ((int)(AP).__va_int &= ~(0x7), \ ! 33: (int)(AP).__va_float &= ~(0x7), \ ! 34: (int)(AP).__va_double &= ~(0x7)) : 0))\ ! 35: : (int)((AP).__va_int -= sizeof (TYPE *), \ ! 36: (AP).__va_float -= sizeof (TYPE *), \ ! 37: (AP).__va_double -= sizeof (TYPE *))), \ ! 38: (((AP).__va_int < (AP).__va_stack_start \ ! 39: || __builtin_classify_type (* (TYPE *) 0) != 8) \ ! 40: ? ((__va_rounded_size(TYPE) <= 8) ? *(TYPE *)(AP).__va_int \ ! 41: : **(TYPE **)(AP).__va_int) \ ! 42: : ((__va_rounded_size(TYPE) <= 4) ? *(TYPE *)(AP).__va_float \ ! 43: : ((__va_rounded_size(TYPE) <= 8) ? *(TYPE *)(AP).__va_double \ ! 44: : **(TYPE **)(AP).__va_int)))) ! 45: 1.1 root 46: 47: void va_end (va_list); /* Defined in libgcc.a */ 48: #define va_end(AP) 49: 50: #else /* __GNUCC__ > 1 */ 51: 1.1.1.2 ! root 52: typedef char *va_list; ! 53: 1.1 root 54: /* __builtin_saveregs () tickles a bug in the pa-risc gcc 1.39 port, */ 55: /* so don't use it for varargs. Obviously the stdarg stuff doesn't */ 56: /* work very well. */ 57: 58: #ifdef _STDARG_H 59: #define va_start(AP,LASTARG) \ 60: (__builtin_saveregs(), (AP) = __builtin_next_arg ()) 61: 62: /* gcc1 doesn't implement pass by invisible reference */ 63: #define __va_rounded_size(TYPE) \ 64: (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) 65: 66: #define va_arg(AP,TYPE) \ 67: ((AP) -= __va_rounded_size (TYPE), (__alignof__ (TYPE) > 4 ? \ 68: (int)AP &= ~(0x7) : 0), \ 69: *(TYPE *)(AP)) 70: 71: void va_end (va_list); /* Defined in libgcc.a */ 72: #define va_end(AP) 73: #else /* _STDARG_H */ 74: #define va_alist __va_a__, __va_b__, __va_c__, __va_d__ 75: #define va_dcl int __va_a__, __va_b__, __va_c__, __va_d__; 76: #define va_start(list) list = (char *) &__va_a__, &__va_b__, &__va_c__, \ 77: &__va_d__ 78: 79: # define va_arg(list,mode) *(mode *) ((int) (list = (char *) \ 80: (((int) list + sizeof(int /*__va_a__*/) - sizeof(mode)) & ~(sizeof(mode)-1)) \ 81: - sizeof(int /*__va_a__*/)) + sizeof(int /*__va_a__*/)) 82: 83: #define va_end(list) 84: 85: #endif /* _STDARG_H */ 86: #endif /* __GNUCC__ > 1 */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.