Sync with arm32 (fixes warnings compiling /bin/sh and probably others).

This commit is contained in:
bjh21 2000-12-29 19:30:34 +00:00
parent b1cf284bd6
commit df10cbcda9
2 changed files with 36 additions and 24 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: stdarg.h,v 1.1 2000/05/09 21:56:01 bjh21 Exp $ */
/* $NetBSD: stdarg.h,v 1.2 2000/12/29 19:30:34 bjh21 Exp $ */
/*
* Copyright (c) 1991, 1993
@ -35,16 +35,22 @@
* from: @(#)stdarg.h 8.1 (Berkeley) 6/10/93
*/
#ifndef _STDARG_H_
#define _STDARG_H_
#ifndef _ARM32_STDARG_H_
#define _ARM32_STDARG_H_
typedef char *va_list;
#include <machine/ansi.h>
#include <sys/featuretest.h>
#define __va_promote(type) \
(((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
typedef _BSD_VA_LIST_ va_list;
#ifdef __lint__
#define __builtin_next_arg(t) ((t) ? 0 : 0)
#endif
#define __va_size(type) \
(((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
#define va_start(ap, last) \
(ap = ((char *)&(last) + __va_promote(last)))
((ap) = (va_list)__builtin_next_arg(last))
#ifdef _KERNEL
#define va_arg(ap, type) \
@ -55,6 +61,13 @@ typedef char *va_list;
(abort(), 0) : sizeof(type)))[-1]
#endif
#if !defined(_ANSI_SOURCE) && \
(!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) || \
defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L)
#define va_copy(dest, src) \
((dest) = (src))
#endif
#define va_end(ap)
#endif /* !_STDARG_H_ */
#endif /* !_ARM32_STDARG_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: varargs.h,v 1.1 2000/05/09 21:56:01 bjh21 Exp $ */
/* $NetBSD: varargs.h,v 1.2 2000/12/29 19:30:35 bjh21 Exp $ */
/*
* Copyright (c) 1990, 1993
@ -40,25 +40,24 @@
* from: @(#)varargs.h 8.2 (Berkeley) 3/22/94
*/
#ifndef _MACHINE_VARARGS_H_
#define _MACHINE_VARARGS_H_
#ifndef _ARM32_VARARGS_H_
#define _ARM32_VARARGS_H_
typedef char *va_list;
#include <machine/stdarg.h>
#define va_dcl int va_alist; ...
#define va_start(ap) \
ap = (char *)&va_alist
#ifdef _KERNEL
#define va_arg(ap, type) \
((type *)(ap += sizeof(type)))[-1]
#if __GNUC__ == 1
#define __va_ellipsis
#else
#define va_arg(ap, type) \
((type *)(ap += sizeof(type) < sizeof(int) ? \
(abort(), 0) : sizeof(type)))[-1]
#define __va_ellipsis ...
#endif
#define va_alist __builtin_va_alist
#define va_dcl long __builtin_va_alist; __va_ellipsis
#undef va_start
#define va_start(ap) \
((ap) = (va_list)&__builtin_va_alist)
#define va_end(ap)
#endif /* !_MACHINE_VARARGS_H_ */
#endif /* !_ARM32_VARARGS_H_ */