diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/gcc/ginclude/stdarg.h | 15 | ||||
-rw-r--r-- | contrib/gcc/ginclude/stddef.h | 4 | ||||
-rw-r--r-- | contrib/gcc/ginclude/varargs.h | 15 |
3 files changed, 32 insertions, 2 deletions
diff --git a/contrib/gcc/ginclude/stdarg.h b/contrib/gcc/ginclude/stdarg.h index ca79a3e..166ca58 100644 --- a/contrib/gcc/ginclude/stdarg.h +++ b/contrib/gcc/ginclude/stdarg.h @@ -43,6 +43,15 @@ #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; +#else +typedef _VA_LIST_ __gnuc_va_list; +#endif +#else #ifndef __GNUC_VA_LIST #define __GNUC_VA_LIST @@ -52,6 +61,7 @@ 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. */ @@ -116,9 +126,14 @@ 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__ /* SVR4.2 uses _VA_LIST for an internal alias for va_list, diff --git a/contrib/gcc/ginclude/stddef.h b/contrib/gcc/ginclude/stddef.h index af3071f..a9dc240 100644 --- a/contrib/gcc/ginclude/stddef.h +++ b/contrib/gcc/ginclude/stddef.h @@ -257,7 +257,7 @@ typedef __WCHAR_TYPE__ wchar_t; /* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. are already defined. */ -#ifdef _ANSI_H_ +#if defined(_ANSI_H_) || 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 +285,7 @@ typedef __WCHAR_TYPE__ wchar_t; #undef _WCHAR_T_ #undef _BSD_WCHAR_T_ #endif -#endif /* _ANSI_H_ */ +#endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) */ #endif /* __sys_stdtypes_h */ diff --git a/contrib/gcc/ginclude/varargs.h b/contrib/gcc/ginclude/varargs.h index 691759e..e84d972 100644 --- a/contrib/gcc/ginclude/varargs.h +++ b/contrib/gcc/ginclude/varargs.h @@ -78,12 +78,22 @@ #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 @@ -185,6 +195,11 @@ 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 |