diff --git a/sys/arch/pc532/include/ansi.h b/sys/arch/pc532/include/ansi.h index 841de96316f9..1a35f94fdfc0 100644 --- a/sys/arch/pc532/include/ansi.h +++ b/sys/arch/pc532/include/ansi.h @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,12 +30,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: @(#)ansi.h 7.1 (Berkeley) 3/9/91 - * ansi.h,v 1.1.1.1 1993/09/09 23:53:46 phil Exp + * from: @(#)ansi.h 8.2 (Berkeley) 1/4/94 + * $Id: ansi.h,v 1.4 1994/05/17 02:12:16 cgd Exp $ */ -#ifndef _MACHINE_ANSI_H_ -#define _MACHINE_ANSI_H_ +#ifndef _ANSI_H_ +#define _ANSI_H_ /* * Types which are fundamental to the implementation and may appear in @@ -45,19 +45,29 @@ * typedef _SIZE_T_ size_t; * #undef _SIZE_T_ * #endif - * - * Thanks, ANSI! */ - #define _CLOCK_T_ unsigned long /* clock() */ #define _PTRDIFF_T_ int /* ptr1 - ptr2 */ #define _SIZE_T_ unsigned int /* sizeof() */ +#define _SSIZE_T_ int /* byte count or error */ #define _TIME_T_ long /* time() */ -#define _WCHAR_T_ unsigned short /* wchar_t */ - -/* va_list is "special" in that it is ONLY defined in stdarg.h AND - that _VA_LIST_ is *NOT* undefined as stated in the above comment. */ - #define _VA_LIST_ char * /* va_list */ +/* + * Runes (wchar_t) is declared to be an ``int'' instead of the more natural + * ``unsigned long'' or ``long''. Two things are happening here. It is not + * unsigned so that EOF (-1) can be naturally assigned to it and used. Also, + * it looks like 10646 will be a 31 bit standard. This means that if your + * ints cannot hold 32 bits, you will be in trouble. The reason an int was + * chosen over a long is that the is*() and to*() routines take ints (says + * ANSI C), but they use _RUNE_T_ instead of int. By changing it here, you + * lose a bit of ANSI conformance, but your programs will still work. + * + * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type. When wchar_t + * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains + * defined for ctype.h. + */ +#define _WCHAR_T_ int /* wchar_t */ +#define _RUNE_T_ int /* rune_t */ + #endif /* _ANSI_H_ */ diff --git a/sys/arch/pc532/include/stdarg.h b/sys/arch/pc532/include/stdarg.h index 228771dab27b..7423d1ccb140 100644 --- a/sys/arch/pc532/include/stdarg.h +++ b/sys/arch/pc532/include/stdarg.h @@ -1,6 +1,6 @@ -/* - * Copyright (c) 1993 Philip A. Nelson. - * All rights reserved. +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -12,56 +12,48 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed by Philip A. Nelson. - * 4. The name of Philip A. Nelson may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY PHILIP NELSON ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL PHILIP NELSON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * - * - * Note that the type used in va_arg is supposed to match the - * actual type **after default promotions**. - * Thus, va_arg (..., short) is not valid. - * - * machine/stdarg.h: - * - * stdarg.h,v 1.1.1.1 1993/09/09 23:53:46 phil Exp + * from: @(#)stdarg.h 8.1 (Berkeley) 6/10/93 + * $Id: stdarg.h,v 1.4 1994/05/17 02:12:20 cgd Exp $ */ +#ifndef _STDARG_H_ +#define _STDARG_H_ -#ifndef _MACHINE_STDARG_H_ -#define _MACHINE_STDARG_H_ +typedef char *va_list; -#include /* to make sure _VA_LIST_ is defined. */ +#define __va_promote(type) \ + (((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int)) -/* See comment in machine/ansi.h as to why it is this way. */ -typedef _VA_LIST_ va_list; - -/* Amount of space required in an argument list for an arg of type TYPE. - TYPE may alternatively be an expression whose type is used. */ - -#define __va_rounded_size(TYPE) \ - (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) - -#define va_start(AP, LASTARG) \ - (AP = ((char *) __builtin_next_arg ())) - -void va_end (va_list); -#define va_end(AP) - -#define va_arg(AP, TYPE) \ - (*((TYPE *) (AP += __va_rounded_size (TYPE), \ - AP - (sizeof (TYPE) < 4 ? sizeof (TYPE) \ - : __va_rounded_size (TYPE))))) +#define va_start(ap, last) \ + (ap = ((char *)&(last) + __va_promote(last))) +#ifdef KERNEL +#define va_arg(ap, type) \ + ((type *)(ap += sizeof(type)))[-1] +#else +#define va_arg(ap, type) \ + ((type *)(ap += sizeof(type) < sizeof(int) ? \ + (abort(), 0) : sizeof(type)))[-1] #endif + +#define va_end(ap) + +#endif /* !_STDARG_H_ */ diff --git a/sys/arch/pc532/include/varargs.h b/sys/arch/pc532/include/varargs.h index 0ad3599654f0..9c7c5e670266 100644 --- a/sys/arch/pc532/include/varargs.h +++ b/sys/arch/pc532/include/varargs.h @@ -1 +1,63 @@ -revision 1.1 intentionally removed +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)varargs.h 8.2 (Berkeley) 3/22/94 + * $Id: varargs.h,v 1.2 1994/05/17 02:12:21 cgd Exp $ + */ + +#ifndef _VARARGS_H_ +#define _VARARGS_H_ + +typedef char *va_list; + +#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] +#else +#define va_arg(ap, type) \ + ((type *)(ap += sizeof(type) < sizeof(int) ? \ + (abort(), 0) : sizeof(type)))[-1] +#endif + +#define va_end(ap) + +#endif /* !_VARARGS_H_ */