--- gcc/ginclude/stdarg.h 2018/04/24 18:23:45 1.1.1.1 +++ gcc/ginclude/stdarg.h 2018/04/24 18:31:28 1.1.1.2 @@ -38,12 +38,15 @@ #if defined (__H8300__) || defined (__H8300H__) #include #else +#if defined (__PPC__) && defined (_CALL_SYSV) +#include +#else /* Define __gnuc_va_list. */ #ifndef __GNUC_VA_LIST #define __GNUC_VA_LIST -#if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) +#if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__) typedef char *__gnuc_va_list; #else typedef void *__gnuc_va_list; @@ -70,7 +73,7 @@ typedef void *__gnuc_va_list; #undef va_end void va_end (__gnuc_va_list); /* Defined in libgcc.a */ -#define va_end(AP) +#define va_end(AP) ((void)0) /* We cast to void * and then to TYPE * because this avoids a warning about increasing the alignment requirement. */ @@ -84,12 +87,13 @@ void va_end (__gnuc_va_list); /* Define /* This is for big-endian machines; small args are padded downward. */ #define va_arg(AP, TYPE) \ (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ - *((TYPE *) (void *) ((char *) (AP) - ((sizeof (TYPE) < 4 \ - ? sizeof (TYPE) \ - : __va_rounded_size (TYPE)))))) + *((TYPE *) (void *) ((char *) (AP) \ + - ((sizeof (TYPE) < __va_rounded_size (char) \ + ? sizeof (TYPE) : __va_rounded_size (TYPE)))))) #endif /* big-endian */ #endif /* _STDARG_H */ +#endif /* not powerpc with V.4 calling sequence */ #endif /* not h8300 */ #endif /* not alpha */ #endif /* not i960 */ @@ -136,20 +140,31 @@ typedef __gnuc_va_list va_list; But on BSD NET2 we must not test or define or undef it. (Note that the comments in NET 2's ansi.h are incorrect for _VA_LIST_--see stdio.h!) */ -#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__FreeBSD__) +#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT) +/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */ +#ifndef _VA_LIST_DEFINED /* The macro _VA_LIST is used in SCO Unix 3.2. */ #ifndef _VA_LIST /* The macro _VA_LIST_T_H is used in the Bull dpx2 */ #ifndef _VA_LIST_T_H -#define _VA_LIST_T_H -#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__FreeBSD__)) -#define _VA_LIST_ -#endif -#define _VA_LIST typedef __gnuc_va_list va_list; #endif /* not _VA_LIST_T_H */ #endif /* not _VA_LIST */ -#endif /* not _VA_LIST_ */ +#endif /* not _VA_LIST_DEFINED */ +#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__)) +#define _VA_LIST_ +#endif +#ifndef _VA_LIST +#define _VA_LIST +#endif +#ifndef _VA_LIST_DEFINED +#define _VA_LIST_DEFINED +#endif +#ifndef _VA_LIST_T_H +#define _VA_LIST_T_H +#endif + +#endif /* not _VA_LIST_, except on certain systems */ #endif /* not __svr4__ */