Patches originally obtained from Bruce Evans <bde@freebsd.org> to make

gcc "do the right thing" when running standalone on FreeBSD
This commit is contained in:
Peter Wemm 1996-09-18 06:31:42 +00:00
parent b3618bcf57
commit 97d25bbf44
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18341
3 changed files with 32 additions and 2 deletions

View File

@ -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,

View File

@ -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 */

View File

@ -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