va-sparc.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* Copyright 2000 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* This is just like the default gvarargs.h
except for differences described below. */
/* Define __gnuc_va_list. */
#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __sparc_v9__
typedef long long __va_greg;
typedef double __va_freg;
typedef struct {
#else
#ifndef __svr4__
/* This has to be a char * to be compatible with Sun.
i.e., we have to pass a `va_list' to vsprintf. */
typedef char * __gnuc_va_list;
#else
/* This has to be a void * to be compatible with Sun svr4.
i.e., we have to pass a `va_list' to vsprintf. */
typedef void * __gnuc_va_list;
#endif
#endif /* not __sparc_v9__ */
#endif /* not __GNUC_VA_LIST */
/* If this is for internal libc use, don't define anything but
__gnuc_va_list. */
#if defined (_STDARG_H) || defined (_VARARGS_H)
#ifdef _KERNEL
/*
* The Solaris kernel stdarg style va_start() even though it includes
*/
#define _STDARG_H
#endif /* _KERNEL */
#ifdef _STDARG_H
#ifdef __sparc_v9__
({ \
})
#else
/* Call __builtin_next_arg even though we aren't using its value, so that
we can verify that LASTARG is correct. */
#ifdef __GCC_NEW_VARARGS__
#else
#endif
#endif /* not __sparc_v9__ */
#else
#define va_alist __builtin_va_alist
#define va_dcl int __builtin_va_alist;...
#ifdef __sparc_v9__
#ifdef __sparcv9
({ \
})
#else /* __sparcv9 */
({ \
})
#endif /* __sparcv9 */
#else
#ifdef __GCC_NEW_VARARGS__
#else
#endif
#endif /* not __sparc_v9__ */
#endif
#ifndef va_end
/* Values returned by __builtin_classify_type. */
enum __va_type_classes {
__no_type_class = -1,
};
#endif
/* Avoid errors if compiling GCC v2 with GCC v1. */
#if __GNUC__ == 1
#define __extension__
#endif
/* RECORD_TYPE args passed using the C calling convention are
passed by invisible reference. ??? RECORD_TYPE args passed
in the stack are made to be word-aligned; for an aggregate that is
not word-aligned, we advance the pointer to the first non-reg slot. */
#ifdef __sparc_v9__
void * __result; \
{ \
/* see PASS_IN_REG_P in gcc's sparc.h */ \
&& ((__r = (__va_freg *) (((__va_greg) pvar.__va_next_fp + sizeof (TYPE) - 1) & ~(__va_greg) (sizeof (TYPE) - 1))) \
< pvar.__va_next_fp_limit)) \
{ \
} \
else \
{ \
} \
} \
{ \
else \
/* adjust for 4 byte ints */ \
} \
else /* aggregate object */ \
{ \
void **__r; \
else \
} \
#else /* not __sparc_v9__ */
#define __va_rounded_size(TYPE) \
(((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
/* We don't declare the union member `d' to have type TYPE
because that would lose in C++ if TYPE has a constructor. */
/* We cast to void * and then to TYPE * because this avoids
a warning about increasing the alignment requirement.
The casts to char * avoid warnings about invalid pointer arithmetic. */
&& sizeof (TYPE) == 16)) \
#endif /* not __sparc_v9__ */
#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */