From 605c5586ca8f03cfb3c735115fd5b5e50b0cad6e Mon Sep 17 00:00:00 2001 From: millert <> Date: Fri, 6 Jan 2006 18:53:04 +0000 Subject: [PATCH] Adapt things to use __type_t instead of _BSD_TYPE_T_ Add new sys/_types.h header Include machine/_types.h or sys/_types.h where applicable --- src/include/bsd_auth.h | 6 ++++-- src/include/err.h | 22 +++++++++++----------- src/include/search.h | 10 +++++----- src/include/stddef.h | 36 +++++++++++++++++++----------------- src/include/stdio.h | 35 +++++++++++++++++------------------ src/include/stdlib.h | 20 +++++++++----------- src/include/string.h | 10 +++++----- src/include/time.h | 22 +++++++++++----------- src/include/utime.h | 13 ++++++------- src/include/wchar.h | 30 ++++++++++++++---------------- src/include/wctype.h | 22 +++++++++++----------- 11 files changed, 112 insertions(+), 114 deletions(-) diff --git a/src/include/bsd_auth.h b/src/include/bsd_auth.h index 800ec13c..31cb5af8 100644 --- a/src/include/bsd_auth.h +++ b/src/include/bsd_auth.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bsd_auth.h,v 1.8 2002/08/30 08:50:01 espie Exp $ */ +/* $OpenBSD: bsd_auth.h,v 1.9 2006/01/06 18:53:04 millert Exp $ */ /*- * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved. @@ -37,6 +37,8 @@ #ifndef _BSD_AUTH_H_ #define _BSD_AUTH_H_ +#include /* for __va_list */ + typedef struct auth_session_t auth_session_t; typedef enum { @@ -84,7 +86,7 @@ int auth_call(auth_session_t *, char *, ...) int auth_setdata(auth_session_t *, void *, size_t); int auth_setoption(auth_session_t *, char *, char *); int auth_setpwd(auth_session_t *, struct passwd *pwd); -void auth_set_va_list(auth_session_t *, _BSD_VA_LIST_); +void auth_set_va_list(auth_session_t *, __va_list); struct passwd *auth_getpwd(auth_session_t *); diff --git a/src/include/err.h b/src/include/err.h index 4878b7ea..56d3b288 100644 --- a/src/include/err.h +++ b/src/include/err.h @@ -1,4 +1,4 @@ -/* $OpenBSD: err.h,v 1.9 2003/06/02 19:34:12 millert Exp $ */ +/* $OpenBSD: err.h,v 1.10 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: err.h,v 1.11 1994/10/26 00:55:52 cgd Exp $ */ /*- @@ -40,28 +40,28 @@ * places ( and ), so if we include one * of them here we may collide with the utility's includes. It's unreasonable * for utilities to have to include one of them to include err.h, so we get - * _BSD_VA_LIST_ from and use it. + * __va_list from and use it. */ -#include #include +#include __BEGIN_DECLS __dead void err(int, const char *, ...) __attribute__((__format__ (printf, 2, 3))); -__dead void verr(int, const char *, _BSD_VA_LIST_) +__dead void verr(int, const char *, __va_list) __attribute__((__format__ (printf, 2, 0))); __dead void errx(int, const char *, ...) __attribute__((__format__ (printf, 2, 3))); -__dead void verrx(int, const char *, _BSD_VA_LIST_) +__dead void verrx(int, const char *, __va_list) __attribute__((__format__ (printf, 2, 0))); void warn(const char *, ...) __attribute__((__format__ (printf, 1, 2))); -void vwarn(const char *, _BSD_VA_LIST_) +void vwarn(const char *, __va_list) __attribute__((__format__ (printf, 1, 0))); void warnx(const char *, ...) __attribute__((__format__ (printf, 1, 2))); -void vwarnx(const char *, _BSD_VA_LIST_) +void vwarnx(const char *, __va_list) __attribute__((__format__ (printf, 1, 0))); /* @@ -70,19 +70,19 @@ void vwarnx(const char *, _BSD_VA_LIST_) */ __dead void _err(int, const char *, ...) __attribute__((__format__ (printf, 2, 3))); -__dead void _verr(int, const char *, _BSD_VA_LIST_) +__dead void _verr(int, const char *, __va_list) __attribute__((__format__ (printf, 2, 0))); __dead void _errx(int, const char *, ...) __attribute__((__format__ (printf, 2, 3))); -__dead void _verrx(int, const char *, _BSD_VA_LIST_) +__dead void _verrx(int, const char *, __va_list) __attribute__((__format__ (printf, 2, 0))); void _warn(const char *, ...) __attribute__((__format__ (printf, 1, 2))); -void _vwarn(const char *, _BSD_VA_LIST_) +void _vwarn(const char *, __va_list) __attribute__((__format__ (printf, 1, 0))); void _warnx(const char *, ...) __attribute__((__format__ (printf, 1, 2))); -void _vwarnx(const char *, _BSD_VA_LIST_) +void _vwarnx(const char *, __va_list) __attribute__((__format__ (printf, 1, 0))); __END_DECLS diff --git a/src/include/search.h b/src/include/search.h index 80a60db5..4d596dad 100644 --- a/src/include/search.h +++ b/src/include/search.h @@ -1,4 +1,4 @@ -/* $OpenBSD: search.h,v 1.7 2004/07/08 21:15:11 millert Exp $ */ +/* $OpenBSD: search.h,v 1.8 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: search.h,v 1.9 1995/08/08 21:14:45 jtc Exp $ */ /* @@ -10,11 +10,11 @@ #define _SEARCH_H_ #include -#include +#include -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; #endif typedef struct entry { diff --git a/src/include/stddef.h b/src/include/stddef.h index 467a51ed..a2ec869e 100644 --- a/src/include/stddef.h +++ b/src/include/stddef.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stddef.h,v 1.8 2005/05/11 18:44:12 espie Exp $ */ +/* $OpenBSD: stddef.h,v 1.9 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: stddef.h,v 1.4 1994/10/26 00:56:26 cgd Exp $ */ /*- @@ -35,31 +35,33 @@ #ifndef _STDDEF_H_ #define _STDDEF_H_ -#include +#include +#include -typedef _BSD_PTRDIFF_T_ ptrdiff_t; +#ifndef _PTRDIFF_T_DEFINED_ +#define _PTRDIFF_T_DEFINED_ +typedef __ptrdiff_t ptrdiff_t; +#endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; #endif -#ifdef _BSD_WCHAR_T_ /* in C++, wchar_t is a built-in type */ -#ifndef __cplusplus -typedef _BSD_WCHAR_T_ wchar_t; -#undef _BSD_WCHAR_T_ -#endif +#if !defined(_WCHAR_T_DEFINED_) && !defined(__cplusplus) +#define _WCHAR_T_DEFINED_ +typedef __wchar_t wchar_t; #endif -#ifdef _BSD_WINT_T_ -typedef _BSD_WINT_T_ wint_t; -#undef _BSD_WINT_T_ +#ifndef _WINT_T_DEFINED_ +#define _WINT_T_DEFINED_ +typedef __wint_t wint_t; #endif -#ifdef _BSD_MBSTATE_T_ -typedef _BSD_MBSTATE_T_ mbstate_t; -#undef _BSD_MBSTATE_T_ +#ifndef _MBSTATE_T_DEFINED_ +#define _MBSTATE_T_DEFINED_ +typedef __mbstate_t mbstate_t; #endif #ifndef NULL diff --git a/src/include/stdio.h b/src/include/stdio.h index 26d2f40c..daae349f 100644 --- a/src/include/stdio.h +++ b/src/include/stdio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdio.h,v 1.33 2005/12/13 00:35:22 millert Exp $ */ +/* $OpenBSD: stdio.h,v 1.34 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */ /*- @@ -39,21 +39,20 @@ #define _STDIO_H_ #include +#include #if __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE -#include +#include /* XXX should be removed */ #endif -#include - -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; #endif -#ifdef _BSD_OFF_T_ -typedef _BSD_OFF_T_ off_t; -#undef _BSD_OFF_T_ +#ifndef _OFF_T_DEFINED_ +#define _OFF_T_DEFINED_ +typedef __off_t off_t; #endif #ifndef NULL @@ -258,26 +257,26 @@ int sscanf(const char *, const char *, ...); FILE *tmpfile(void); char *tmpnam(char *); int ungetc(int, FILE *); -int vfprintf(FILE *, const char *, _BSD_VA_LIST_); -int vprintf(const char *, _BSD_VA_LIST_); -int vsprintf(char *, const char *, _BSD_VA_LIST_); +int vfprintf(FILE *, const char *, __va_list); +int vprintf(const char *, __va_list); +int vsprintf(char *, const char *, __va_list); #if __ISO_C_VISIBLE >= 1999 || __BSD_VISIBLE int snprintf(char *, size_t, const char *, ...) __attribute__((__format__ (printf, 3, 4))) __attribute__((__nonnull__ (3))) __attribute__((__bounded__ (__string__,1,2))); -int vfscanf(FILE *, const char *, _BSD_VA_LIST_) +int vfscanf(FILE *, const char *, __va_list) __attribute__((__format__ (scanf, 2, 0))) __attribute__((__nonnull__ (2))); -int vscanf(const char *, _BSD_VA_LIST_) +int vscanf(const char *, __va_list) __attribute__((__format__ (scanf, 1, 0))) __attribute__((__nonnull__ (1))); -int vsnprintf(char *, size_t, const char *, _BSD_VA_LIST_) +int vsnprintf(char *, size_t, const char *, __va_list) __attribute__((__format__ (printf, 3, 0))) __attribute__((__nonnull__ (3))) __attribute__((__bounded__(__string__,1,2))); -int vsscanf(const char *, const char *, _BSD_VA_LIST_) +int vsscanf(const char *, const char *, __va_list) __attribute__((__format__ (scanf, 2, 0))) __attribute__((__nonnull__ (2))); #endif /* __ISO_C_VISIBLE >= 1999 || __BSD_VISIBLE */ @@ -346,7 +345,7 @@ int getw(FILE *); int putw(int, FILE *); void setbuffer(FILE *, char *, int); int setlinebuf(FILE *); -int vasprintf(char **, const char *, _BSD_VA_LIST_) +int vasprintf(char **, const char *, __va_list) __attribute__((__format__ (printf, 2, 0))) __attribute__((__nonnull__ (2))); __END_DECLS diff --git a/src/include/stdlib.h b/src/include/stdlib.h index ea714e42..5edd8236 100644 --- a/src/include/stdlib.h +++ b/src/include/stdlib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdlib.h,v 1.35 2005/12/13 00:35:22 millert Exp $ */ +/* $OpenBSD: stdlib.h,v 1.36 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */ /*- @@ -34,24 +34,22 @@ #ifndef _STDLIB_H_ #define _STDLIB_H_ -#include #include -#if __BSD_VISIBLE /* for quad_t, etc. */ +#include +#if __BSD_VISIBLE /* for quad_t, etc. (XXX - use protected types) */ #include #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; #endif -#ifdef _BSD_WCHAR_T_ /* in C++, wchar_t is a built-in type */ -#ifndef __cplusplus -typedef _BSD_WCHAR_T_ wchar_t; -#endif -#undef _BSD_WCHAR_T_ +#if !defined(_WCHAR_T_DEFINED_) && !defined(__cplusplus) +#define _WCHAR_T_DEFINED_ +typedef __wchar_t wchar_t; #endif typedef struct { diff --git a/src/include/string.h b/src/include/string.h index 7a3c5337..0c42e57a 100644 --- a/src/include/string.h +++ b/src/include/string.h @@ -1,4 +1,4 @@ -/* $OpenBSD: string.h,v 1.16 2005/12/13 00:35:22 millert Exp $ */ +/* $OpenBSD: string.h,v 1.17 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: string.h,v 1.6 1994/10/26 00:56:30 cgd Exp $ */ /*- @@ -36,11 +36,11 @@ #define _STRING_H_ #include -#include +#include -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; #endif #ifndef NULL diff --git a/src/include/time.h b/src/include/time.h index 41ebba4a..dfaffabe 100644 --- a/src/include/time.h +++ b/src/include/time.h @@ -1,4 +1,4 @@ -/* $OpenBSD: time.h,v 1.17 2005/12/13 00:35:22 millert Exp $ */ +/* $OpenBSD: time.h,v 1.18 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */ /* @@ -42,7 +42,7 @@ #define _TIME_H_ #include -#include +#include #ifndef NULL #ifdef __GNUG__ @@ -52,19 +52,19 @@ #endif #endif -#ifdef _BSD_CLOCK_T_ -typedef _BSD_CLOCK_T_ clock_t; -#undef _BSD_CLOCK_T_ +#ifndef _CLOCK_T_DEFINED_ +#define _CLOCK_T_DEFINED_ +typedef __clock_t clock_t; #endif -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ +#ifndef _TIME_T_DEFINED_ +#define _TIME_T_DEFINED_ +typedef __time_t time_t; #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; #endif #if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE diff --git a/src/include/utime.h b/src/include/utime.h index 3b85ff59..9fab94f8 100644 --- a/src/include/utime.h +++ b/src/include/utime.h @@ -1,4 +1,4 @@ -/* $OpenBSD: utime.h,v 1.5 2003/06/02 19:34:12 millert Exp $ */ +/* $OpenBSD: utime.h,v 1.6 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: utime.h,v 1.3 1994/10/26 00:56:39 cgd Exp $ */ /*- @@ -35,11 +35,12 @@ #ifndef _UTIME_H_ #define _UTIME_H_ -#include +#include +#include -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ +#ifndef _TIME_T_DEFINED_ +#define _TIME_T_DEFINED_ +typedef __time_t time_t; #endif struct utimbuf { @@ -47,8 +48,6 @@ struct utimbuf { time_t modtime; /* Modification time */ }; -#include - __BEGIN_DECLS int utime(const char *, const struct utimbuf *); __END_DECLS diff --git a/src/include/wchar.h b/src/include/wchar.h index b1a651e5..90dbce5d 100644 --- a/src/include/wchar.h +++ b/src/include/wchar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wchar.h,v 1.7 2005/12/19 17:05:20 millert Exp $ */ +/* $OpenBSD: wchar.h,v 1.8 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: wchar.h,v 1.16 2003/03/07 07:11:35 tshiozak Exp $ */ /*- @@ -67,7 +67,7 @@ #define _WCHAR_H_ #include -#include +#include #ifndef NULL #ifdef __GNUG__ @@ -79,26 +79,24 @@ #include /* for FILE* */ -#ifdef _BSD_WCHAR_T_ -# ifndef __cplusplus -typedef _BSD_WCHAR_T_ wchar_t; -# endif -#undef _BSD_WCHAR_T_ +#if !defined(_WCHAR_T_DEFINED_) && !defined(__cplusplus) +#define _WCHAR_T_DEFINED_ +typedef __wchar_t wchar_t; #endif -#ifdef _BSD_MBSTATE_T_ -typedef _BSD_MBSTATE_T_ mbstate_t; -#undef _BSD_MBSTATE_T_ +#ifndef _MBSTATE_T_DEFINED_ +#define _MBSTATE_T_DEFINED_ +typedef __mbstate_t mbstate_t; #endif -#ifdef _BSD_WINT_T_ -typedef _BSD_WINT_T_ wint_t; -#undef _BSD_WINT_T_ +#ifndef _WINT_T_DEFINED_ +#define _WINT_T_DEFINED_ +typedef __wint_t wint_t; #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; #endif #ifndef WEOF diff --git a/src/include/wctype.h b/src/include/wctype.h index 051c2730..5d4e5573 100644 --- a/src/include/wctype.h +++ b/src/include/wctype.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wctype.h,v 1.4 2005/07/01 08:59:27 espie Exp $ */ +/* $OpenBSD: wctype.h,v 1.5 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: wctype.h,v 1.5 2003/03/02 22:18:11 tshiozak Exp $ */ /*- @@ -33,21 +33,21 @@ #define _WCTYPE_H_ #include -#include +#include -#ifdef _BSD_WINT_T_ -typedef _BSD_WINT_T_ wint_t; -#undef _BSD_WINT_T_ +#ifndef _WINT_T_DEFINED_ +#define _WINT_T_DEFINED_ +typedef __wint_t wint_t; #endif -#ifdef _BSD_WCTRANS_T_ -typedef _BSD_WCTRANS_T_ wctrans_t; -#undef _BSD_WCTRANS_T_ +#ifndef _WCTRANS_T_DEFINED_ +#define _WCTRANS_T_DEFINED_ +typedef __wctrans_t wctrans_t; #endif -#ifdef _BSD_WCTYPE_T_ -typedef _BSD_WCTYPE_T_ wctype_t; -#undef _BSD_WCTYPE_T_ +#ifndef _WCTYPE_T_DEFINED_ +#define _WCTYPE_T_DEFINED_ +typedef __wctype_t wctype_t; #endif #ifndef WEOF