#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
+#ifndef _SYS_VA_LIST_H
+#define _SYS_VA_LIST_H /* Solaris sys/va_list.h */
+
+/* Solaris decided to rename overflow_arg_area to input_arg_area,
+ so handle it via a macro. */
+#define __va_overflow(AP) (AP)->overflow_arg_area
+
/* Note that the names in this structure are in the user's namespace, but
that the V.4 abi explicitly states that these names should be used. */
-typedef struct {
+typedef struct __va_list_tag {
char gpr; /* index into the array of 8 GPRs stored in the
register save area gpr=0 corresponds to r3,
gpr=1 to r4, etc. */
char *overflow_arg_area; /* location on stack that holds the next
overflow argument */
char *reg_save_area; /* where r3:r10 and f1:f8, if saved are stored */
-} __gnuc_va_list[1];
+} __va_list[1], __gnuc_va_list[1];
+
+#else /* _SYS_VA_LIST */
+
+typedef __va_list __gnuc_va_list;
+#define __va_overflow(AP) (AP)->input_arg_area
+
+#endif /* not _SYS_VA_LIST */
#endif /* not __GNUC_VA_LIST */
/* If this is for internal libc use, don't define anything but
(AP)->fpr = __va_fregno - 33; \
(AP)->reg_save_area = (((char *) __builtin_frame_address (0)) \
+ __va_varargs_offset); \
- (AP)->overflow_arg_area = ((char *)__builtin_saveregs () \
- + (((__words >= 8) ? __words - 8 : 0) \
- * sizeof (long))); \
+ __va_overflow(AP) = ((char *)__builtin_saveregs () \
+ + (((__words >= 8) ? __words - 8 : 0) \
+ * sizeof (long))); \
(void)0; \
})
&& (AP)->gpr < 8) \
{ \
(AP)->gpr = 8; \
- __ptr = (TYPE *) (void *) ((AP)->overflow_arg_area); \
- (AP)->overflow_arg_area += __va_size (TYPE) * sizeof (long); \
+ __ptr = (TYPE *) (void *) (__va_overflow(AP)); \
+ __va_overflow(AP) += __va_size (TYPE) * sizeof (long); \
} \
\
else if (__va_aggregate_p (TYPE)) \
{ \
- __ptr = * (TYPE **) (void *) ((AP)->overflow_arg_area); \
- (AP)->overflow_arg_area += sizeof (TYPE *); \
+ __ptr = * (TYPE **) (void *) (__va_overflow(AP)); \
+ __va_overflow(AP) += sizeof (TYPE *); \
} \
else \
{ \
- if (__va_longlong_p(TYPE) && ((long)(AP)->overflow_arg_area & 4) != 0) \
- (AP)->overflow_arg_area += 4; \
+ if (__va_longlong_p(TYPE) && ((long)__va_overflow(AP) & 4) != 0) \
+ __va_overflow(AP) += 4; \
\
- __ptr = (TYPE *) (void *) ((AP)->overflow_arg_area); \
- (AP)->overflow_arg_area += __va_size (TYPE) * sizeof (long); \
+ __ptr = (TYPE *) (void *) (__va_overflow(AP)); \
+ __va_overflow(AP) += __va_size (TYPE) * sizeof (long); \
} \
\
__ptr; \