190292Sobrien/* Copyright (C) 1989, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
218334Speter
3132727SkanThis file is part of GCC.
490292Sobrien
5132727SkanGCC is free software; you can redistribute it and/or modify
690292Sobrienit under the terms of the GNU General Public License as published by
790292Sobrienthe Free Software Foundation; either version 2, or (at your option)
890292Sobrienany later version.
990292Sobrien
10132727SkanGCC is distributed in the hope that it will be useful,
1190292Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of
1290292SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1390292SobrienGNU General Public License for more details.
1490292Sobrien
1590292SobrienYou should have received a copy of the GNU General Public License
16132727Skanalong with GCC; see the file COPYING.  If not, write to
17169699Skanthe Free Software Foundation, 51 Franklin Street, Fifth Floor,
18169699SkanBoston, MA 02110-1301, USA.  */
1990292Sobrien
2090292Sobrien/* As a special exception, if you include this header file into source
2190292Sobrien   files compiled by GCC, this header file does not by itself cause
2290292Sobrien   the resulting executable to be covered by the GNU General Public
2390292Sobrien   License.  This exception does not however invalidate any other
2490292Sobrien   reasons why the executable file might be covered by the GNU General
2590292Sobrien   Public License.  */
2690292Sobrien
2790292Sobrien/*
2890292Sobrien * ISO C Standard:  7.15  Variable arguments  <stdarg.h>
2990292Sobrien */
3090292Sobrien
3118334Speter#ifndef _STDARG_H
3218334Speter#ifndef _ANSI_STDARG_H_
3318334Speter#ifndef __need___va_list
3418334Speter#define _STDARG_H
3518334Speter#define _ANSI_STDARG_H_
3618334Speter#endif /* not __need___va_list */
3718334Speter#undef __need___va_list
3818334Speter
3952212Sobrien/* Define __gnuc_va_list.  */
4052212Sobrien
4118334Speter#ifndef __GNUC_VA_LIST
4218334Speter#define __GNUC_VA_LIST
4390292Sobrientypedef __builtin_va_list __gnuc_va_list;
4418334Speter#endif
4518334Speter
4618334Speter/* Define the standard macros for the user,
4718334Speter   if this invocation was from the user program.  */
4818334Speter#ifdef _STDARG_H
4918334Speter
50117404Skan#define va_start(v,l)	__builtin_va_start(v,l)
51117404Skan#define va_end(v)	__builtin_va_end(v)
52117404Skan#define va_arg(v,l)	__builtin_va_arg(v,l)
5390292Sobrien#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L
54117404Skan#define va_copy(d,s)	__builtin_va_copy(d,s)
5518334Speter#endif
56117404Skan#define __va_copy(d,s)	__builtin_va_copy(d,s)
5718334Speter
5818334Speter/* Define va_list, if desired, from __gnuc_va_list. */
5918334Speter/* We deliberately do not define va_list when called from
6018334Speter   stdio.h, because ANSI C says that stdio.h is not supposed to define
6118334Speter   va_list.  stdio.h needs to have access to that data type,
6218334Speter   but must not use that name.  It should use the name __gnuc_va_list,
6318334Speter   which is safe because it is reserved for the implementation.  */
6418334Speter
6518334Speter#ifdef _HIDDEN_VA_LIST  /* On OSF1, this means varargs.h is "half-loaded".  */
6618334Speter#undef _VA_LIST
6718334Speter#endif
6818334Speter
6918334Speter#ifdef _BSD_VA_LIST
7018334Speter#undef _BSD_VA_LIST
7118334Speter#endif
7218334Speter
7352212Sobrien#if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
7418334Speter/* SVR4.2 uses _VA_LIST for an internal alias for va_list,
7518334Speter   so we must avoid testing it and setting it here.
7618334Speter   SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
7718334Speter   have no conflict with that.  */
7818334Speter#ifndef _VA_LIST_
7918334Speter#define _VA_LIST_
8018334Speter#ifdef __i860__
8118334Speter#ifndef _VA_LIST
8218334Speter#define _VA_LIST va_list
8318334Speter#endif
8418334Speter#endif /* __i860__ */
8518334Spetertypedef __gnuc_va_list va_list;
8652212Sobrien#ifdef _SCO_DS
8752212Sobrien#define __VA_LIST
8852212Sobrien#endif
8918334Speter#endif /* _VA_LIST_ */
9052212Sobrien#else /* not __svr4__ || _SCO_DS */
9118334Speter
9218334Speter/* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
9318334Speter   But on BSD NET2 we must not test or define or undef it.
9418334Speter   (Note that the comments in NET 2's ansi.h
9518334Speter   are incorrect for _VA_LIST_--see stdio.h!)  */
9618334Speter#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
9718334Speter/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5  */
9818334Speter#ifndef _VA_LIST_DEFINED
9918334Speter/* The macro _VA_LIST is used in SCO Unix 3.2.  */
10018334Speter#ifndef _VA_LIST
10118334Speter/* The macro _VA_LIST_T_H is used in the Bull dpx2  */
10218334Speter#ifndef _VA_LIST_T_H
10390292Sobrien/* The macro __va_list__ is used by BeOS.  */
10490292Sobrien#ifndef __va_list__
10518334Spetertypedef __gnuc_va_list va_list;
10690292Sobrien#endif /* not __va_list__ */
10718334Speter#endif /* not _VA_LIST_T_H */
10818334Speter#endif /* not _VA_LIST */
10918334Speter#endif /* not _VA_LIST_DEFINED */
11018334Speter#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
11118334Speter#define _VA_LIST_
11218334Speter#endif
11318334Speter#ifndef _VA_LIST
11418334Speter#define _VA_LIST
11518334Speter#endif
11618334Speter#ifndef _VA_LIST_DEFINED
11718334Speter#define _VA_LIST_DEFINED
11818334Speter#endif
11918334Speter#ifndef _VA_LIST_T_H
12018334Speter#define _VA_LIST_T_H
12118334Speter#endif
12290292Sobrien#ifndef __va_list__
12390292Sobrien#define __va_list__
12490292Sobrien#endif
12518334Speter
12618334Speter#endif /* not _VA_LIST_, except on certain systems */
12718334Speter
12818334Speter#endif /* not __svr4__ */
12918334Speter
13018334Speter#endif /* _STDARG_H */
13118334Speter
13218334Speter#endif /* not _ANSI_STDARG_H_ */
13318334Speter#endif /* not _STDARG_H */
134