summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--contrib/gcc/ginclude/stdarg.h78
-rw-r--r--contrib/gcc/ginclude/stddef.h57
-rw-r--r--contrib/gcc/ginclude/varargs.h81
3 files changed, 142 insertions, 74 deletions
diff --git a/contrib/gcc/ginclude/stdarg.h b/contrib/gcc/ginclude/stdarg.h
index 166ca58..1a38876 100644
--- a/contrib/gcc/ginclude/stdarg.h
+++ b/contrib/gcc/ginclude/stdarg.h
@@ -3,6 +3,8 @@
actual type **after default promotions**.
Thus, va_arg (..., short) is not valid. */
+/* $FreeBSD$ */
+
#ifndef _STDARG_H
#ifndef _ANSI_STDARG_H_
#ifndef __need___va_list
@@ -12,47 +14,56 @@
#undef __need___va_list
#ifdef __clipper__
-#include <va-clipper.h>
+#include "va-clipper.h"
#else
#ifdef __m88k__
-#include <va-m88k.h>
+#include "va-m88k.h"
#else
#ifdef __i860__
-#include <va-i860.h>
+#include "va-i860.h"
#else
#ifdef __hppa__
-#include <va-pa.h>
+#include "va-pa.h"
#else
#ifdef __mips__
-#include <va-mips.h>
+#include "va-mips.h"
#else
#ifdef __sparc__
-#include <va-sparc.h>
+#include "va-sparc.h"
#else
#ifdef __i960__
-#include <va-i960.h>
+#include "va-i960.h"
#else
#ifdef __alpha__
-#include <va-alpha.h>
+#include "va-alpha.h"
#else
-#if defined (__H8300__) || defined (__H8300H__)
-#include <va-h8300.h>
+#if defined (__H8300__) || defined (__H8300H__) || defined (__H8300S__)
+#include "va-h8300.h"
#else
-#if defined (__PPC__) && defined (_CALL_SYSV)
-#include <va-ppc.h>
+#if defined (__PPC__) && (defined (_CALL_SYSV) || defined (_WIN32))
+#include "va-ppc.h"
#else
-
-/* Define __gnuc_va_list. */
-#if defined (__FreeBSD__)
-/* This is the correct way to handle all BSD NET2 and BSD 4.4 systems. */
-#include <machine/ansi.h>
-#ifdef _BSD_VA_LIST_
-typedef _BSD_VA_LIST_ __gnuc_va_list;
+#ifdef __arc__
+#include "va-arc.h"
#else
-typedef _VA_LIST_ __gnuc_va_list;
-#endif
+#ifdef __M32R__
+#include "va-m32r.h"
+#else
+#ifdef __sh__
+#include "va-sh.h"
+#else
+#ifdef __mn10300__
+#include "va-mn10300.h"
+#else
+#ifdef __mn10200__
+#include "va-mn10200.h"
+#else
+#ifdef __v850__
+#include "va-v850.h"
#else
+/* Define __gnuc_va_list. */
+
#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
#if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__)
@@ -61,7 +72,6 @@ typedef char *__gnuc_va_list;
typedef void *__gnuc_va_list;
#endif
#endif
-#endif
/* Define the standard macros for the user,
if this invocation was from the user program. */
@@ -88,7 +98,7 @@ void va_end (__gnuc_va_list); /* Defined in libgcc.a */
/* We cast to void * and then to TYPE * because this avoids
a warning about increasing the alignment requirement. */
-#if defined (__arm__) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__)
+#if (defined (__arm__) && ! defined (__ARMEB__)) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__)
/* This is for little-endian machines; small args are padded upward. */
#define va_arg(AP, TYPE) \
(AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
@@ -101,8 +111,18 @@ void va_end (__gnuc_va_list); /* Defined in libgcc.a */
- ((sizeof (TYPE) < __va_rounded_size (char) \
? sizeof (TYPE) : __va_rounded_size (TYPE))))))
#endif /* big-endian */
+
+/* Copy __gnuc_va_list into another variable of this type. */
+#define __va_copy(dest, src) (dest) = (src)
+
#endif /* _STDARG_H */
+#endif /* not v850 */
+#endif /* not mn10200 */
+#endif /* not mn10300 */
+#endif /* not sh */
+#endif /* not m32r */
+#endif /* not arc */
#endif /* not powerpc with V.4 calling sequence */
#endif /* not h8300 */
#endif /* not alpha */
@@ -126,16 +146,11 @@ void va_end (__gnuc_va_list); /* Defined in libgcc.a */
#undef _VA_LIST
#endif
-#if 0
-/* BSD 4.4 actually spells the name _BSD_VA_LIST_ and requires it to be
- * defined and usable in place of va_list when the latter name is not
- * allowed (e.g., in stdio.h - see above). */
#ifdef _BSD_VA_LIST
#undef _BSD_VA_LIST
#endif
-#endif
-#ifdef __svr4__
+#if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
/* SVR4.2 uses _VA_LIST for an internal alias for va_list,
so we must avoid testing it and setting it here.
SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
@@ -148,8 +163,11 @@ void va_end (__gnuc_va_list); /* Defined in libgcc.a */
#endif
#endif /* __i860__ */
typedef __gnuc_va_list va_list;
+#ifdef _SCO_DS
+#define __VA_LIST
+#endif
#endif /* _VA_LIST_ */
-#else /* not __svr4__ */
+#else /* not __svr4__ || _SCO_DS */
/* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
But on BSD NET2 we must not test or define or undef it.
diff --git a/contrib/gcc/ginclude/stddef.h b/contrib/gcc/ginclude/stddef.h
index a9dc240..1109391 100644
--- a/contrib/gcc/ginclude/stddef.h
+++ b/contrib/gcc/ginclude/stddef.h
@@ -1,13 +1,17 @@
-#ifndef _STDDEF_H
-#ifndef _STDDEF_H_
-#ifndef _ANSI_STDDEF_H
-#ifndef __STDDEF_H__
+/* $FreeBSD$ */
+
+#if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
+ && !defined(__STDDEF_H__)) \
+ || defined(__need_wchar_t) || defined(__need_size_t) \
+ || defined(__need_ptrdiff_t) || defined(__need_NULL) \
+ || defined(__need_wint_t)
/* Any one of these symbols __need_* means that GNU libc
wants us just to define one data type. So don't define
the symbols that indicate this file's entire job has been done. */
#if (!defined(__need_wchar_t) && !defined(__need_size_t) \
- && !defined(__need_ptrdiff_t) && !defined(__need_NULL))
+ && !defined(__need_ptrdiff_t) && !defined(__need_NULL) \
+ && !defined(__need_wint_t))
#define _STDDEF_H
#define _STDDEF_H_
/* snaroff@next.com says the NeXT needs this. */
@@ -70,7 +74,7 @@
not defined, and so that defining this macro defines _GCC_SIZE_T.
If we find that the macros are still defined at this point, we must
invoke them so that the type is defined as expected. */
-#if defined (TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_))
+#if defined (_TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_))
_TYPE_ptrdiff_t;
#undef _TYPE_ptrdiff_t
#endif
@@ -133,6 +137,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
/* Define this type if we are doing the whole job,
or if we want this type in particular. */
#if defined (_STDDEF_H) || defined (__need_size_t)
+#ifndef __size_t__ /* BeOS */
#ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
#ifndef _SYS_SIZE_T_H
#ifndef _T_SIZE_
@@ -146,6 +151,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
#ifndef _GCC_SIZE_T
#ifndef _SIZET_
#ifndef __size_t
+#define __size_t__ /* BeOS */
#define _SIZE_T
#define _SYS_SIZE_T_H
#define _T_SIZE_
@@ -164,6 +170,9 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
#endif
#if !(defined (__GNUG__) && defined (size_t))
typedef __SIZE_TYPE__ size_t;
+#ifdef __BEOS__
+typedef long ssize_t;
+#endif /* __BEOS__ */
#endif /* !(defined (__GNUG__) && defined (size_t)) */
#endif /* __size_t */
#endif /* _SIZET_ */
@@ -178,6 +187,7 @@ typedef __SIZE_TYPE__ size_t;
#endif /* _T_SIZE_ */
#endif /* _SYS_SIZE_T_H */
#endif /* _SIZE_T */
+#endif /* __size_t__ */
#undef __need_size_t
#endif /* _STDDEF_H or __need_size_t. */
@@ -190,6 +200,7 @@ typedef __SIZE_TYPE__ size_t;
/* Define this type if we are doing the whole job,
or if we want this type in particular. */
#if defined (_STDDEF_H) || defined (__need_wchar_t)
+#ifndef __wchar_t__ /* BeOS */
#ifndef _WCHAR_T
#ifndef _T_WCHAR_
#ifndef _T_WCHAR
@@ -202,6 +213,7 @@ typedef __SIZE_TYPE__ size_t;
#ifndef ___int_wchar_t_h
#ifndef __INT_WCHAR_T_H
#ifndef _GCC_WCHAR_T
+#define __wchar_t__ /* BeOS */
#define _WCHAR_T
#define _T_WCHAR_
#define _T_WCHAR
@@ -235,8 +247,12 @@ typedef _BSD_RUNE_T_ rune_t;
#endif
#ifndef __WCHAR_TYPE__
+#ifdef __BEOS__
+#define __WCHAR_TYPE__ unsigned char
+#else
#define __WCHAR_TYPE__ int
#endif
+#endif
#ifndef __cplusplus
typedef __WCHAR_TYPE__ wchar_t;
#endif
@@ -252,12 +268,27 @@ typedef __WCHAR_TYPE__ wchar_t;
#endif
#endif
#endif
+#endif /* __wchar_t__ */
#undef __need_wchar_t
#endif /* _STDDEF_H or __need_wchar_t. */
+#if defined (_STDDEF_H) || defined (__need_wint_t)
+#ifndef _WINT_T
+#define _WINT_T
+
+#ifndef __WINT_TYPE__
+#define __WINT_TYPE__ unsigned int
+#endif
+typedef __WINT_TYPE__ wint_t;
+#endif
+#undef __need_wint_t
+#endif
+
/* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
are already defined. */
-#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
+/* BSD/OS 3.1 requires the MACHINE_ANSI_H check here. FreeBSD 2.x apparently
+ does not, even though there is a check for MACHINE_ANSI_H above. */
+#if defined(_ANSI_H_) || (defined(__bsdi__) && defined(_MACHINE_ANSI_H_))
/* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
are probably typos and should be removed before 2.8 is released. */
#ifdef _GCC_PTRDIFF_T_
@@ -285,7 +316,7 @@ typedef __WCHAR_TYPE__ wchar_t;
#undef _WCHAR_T_
#undef _BSD_WCHAR_T_
#endif
-#endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) */
+#endif /* _ANSI_H_ || ( __bsdi__ && _MACHINE_ANSI_H_ ) */
#endif /* __sys_stdtypes_h */
@@ -293,7 +324,11 @@ typedef __WCHAR_TYPE__ wchar_t;
#if defined (_STDDEF_H) || defined (__need_NULL)
#undef NULL /* in case <stdio.h> has defined it. */
+#ifdef __GNUG__
+#define NULL __null
+#else /* G++ */
#define NULL ((void *)0)
+#endif /* G++ */
#endif /* NULL not defined and <stddef.h> or need NULL. */
#undef __need_NULL
@@ -305,7 +340,5 @@ typedef __WCHAR_TYPE__ wchar_t;
#endif /* _STDDEF_H was defined this time */
-#endif /* __STDDEF_H__ was not defined before */
-#endif /* _ANSI_STDDEF_H was not defined before */
-#endif /* _STDDEF_H_ was not defined before */
-#endif /* _STDDEF_H was not defined before */
+#endif /* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__
+ || __need_XXX was not defined before */
diff --git a/contrib/gcc/ginclude/varargs.h b/contrib/gcc/ginclude/varargs.h
index e84d972..2aeee5b 100644
--- a/contrib/gcc/ginclude/varargs.h
+++ b/contrib/gcc/ginclude/varargs.h
@@ -1,43 +1,63 @@
/* Record that this is varargs.h; this turns off stdarg.h. */
+/* $FreeBSD$ */
+
#ifndef _VARARGS_H
#define _VARARGS_H
#ifdef __sparc__
-#include <va-sparc.h>
+#include "va-sparc.h"
#else
#ifdef __spur__
-#include <va-spur.h>
+#include "va-spur.h"
#else
#ifdef __mips__
-#include <va-mips.h>
+#include "va-mips.h"
#else
#ifdef __i860__
-#include <va-i860.h>
+#include "va-i860.h"
#else
#ifdef __pyr__
-#include <va-pyr.h>
+#include "va-pyr.h"
#else
#ifdef __clipper__
-#include <va-clipper.h>
+#include "va-clipper.h"
#else
#ifdef __m88k__
-#include <va-m88k.h>
+#include "va-m88k.h"
#else
#if defined(__hppa__) || defined(hp800)
-#include <va-pa.h>
+#include "va-pa.h"
#else
#ifdef __i960__
-#include <va-i960.h>
+#include "va-i960.h"
#else
#ifdef __alpha__
-#include <va-alpha.h>
+#include "va-alpha.h"
+#else
+#if defined (__H8300__) || defined (__H8300H__) || defined (__H8300S__)
+#include "va-h8300.h"
+#else
+#if defined (__PPC__) && (defined (_CALL_SYSV) || defined (_WIN32))
+#include "va-ppc.h"
+#else
+#ifdef __arc__
+#include "va-arc.h"
+#else
+#ifdef __M32R__
+#include "va-m32r.h"
+#else
+#ifdef __sh__
+#include "va-sh.h"
+#else
+#ifdef __mn10300__
+#include "va-mn10300.h"
#else
-#if defined (__H8300__) || defined (__H8300H__)
-#include <va-h8300.h>
+#ifdef __mn10200__
+#include "va-mn10200.h"
#else
-#if defined (__PPC__) && defined (_CALL_SYSV)
-#include <va-ppc.h>
+#ifdef __v850__
+#include "va-v850.h"
#else
#ifdef __NeXT__
@@ -78,22 +98,12 @@
#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
-#if defined (__FreeBSD__)
-/* This is the correct way to handle all BSD NET2 and BSD 4.4 systems. */
-#include <machine/ansi.h>
-#ifdef _BSD_VA_LIST_
-typedef _BSD_VA_LIST_ __gnuc_va_list;
-#else
-typedef _VA_LIST_ __gnuc_va_list;
-#endif
-#else
#if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
typedef char *__gnuc_va_list;
#else
typedef void *__gnuc_va_list;
#endif
#endif
-#endif
#define va_start(AP) AP=(char *) &__builtin_va_alist
@@ -107,7 +117,7 @@ typedef void *__gnuc_va_list;
(((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
#endif
-#if defined (__arm__) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__)
+#if (defined (__arm__) && ! defined (__ARMEB__)) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__)
/* This is for little-endian machines; small args are padded upward. */
#define va_arg(AP, TYPE) \
(AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
@@ -121,6 +131,15 @@ typedef void *__gnuc_va_list;
? sizeof (TYPE) : __va_rounded_size (TYPE))))))
#endif /* big-endian */
+/* Copy __gnuc_va_list into another variable of this type. */
+#define __va_copy(dest, src) (dest) = (src)
+
+#endif /* not v850 */
+#endif /* not mn10200 */
+#endif /* not mn10300 */
+#endif /* not sh */
+#endif /* not m32r */
+#endif /* not arc */
#endif /* not powerpc with V.4 calling sequence */
#endif /* not h8300 */
#endif /* not alpha */
@@ -141,7 +160,7 @@ typedef void *__gnuc_va_list;
#undef _VA_LIST
#endif
-#ifdef __svr4__
+#if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
/* SVR4.2 uses _VA_LIST for an internal alias for va_list,
so we must avoid testing it and setting it here.
SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
@@ -154,9 +173,12 @@ typedef void *__gnuc_va_list;
#endif
#endif /* __i860__ */
typedef __gnuc_va_list va_list;
+#ifdef _SCO_DS
+#define __VA_LIST
+#endif
#endif /* _VA_LIST_ */
-#else /* not __svr4__ */
+#else /* not __svr4__ || _SCO_DS */
/* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
But on BSD NET2 we must not test or define or undef it.
@@ -195,11 +217,6 @@ typedef __gnuc_va_list va_list;
/* The next BSD release (if there is one) wants this symbol to be
undefined instead of _VA_LIST_. */
-#if 0
-/* BSD 4.4 actually spells the name _BSD_VA_LIST_ and requires it to be
- * defined and usable in place of va_list when the latter name is not
- * allowed (e.g., in stdio.h - see ginclude/stdarg.h). */
#ifdef _BSD_VA_LIST
#undef _BSD_VA_LIST
#endif
-#endif
OpenPOWER on IntegriCloud