diff options
93 files changed, 1380 insertions, 1402 deletions
diff --git a/include/_ctype.h b/include/_ctype.h index 15a5b227..e3d574d 100644 --- a/include/_ctype.h +++ b/include/_ctype.h @@ -126,11 +126,11 @@ __END_DECLS #define toascii(c) ((c) & 0x7F) #endif -/* See comments in <machine/ansi.h> about _BSD_CT_RUNE_T_. */ +/* See comments in <machine/_types.h> about __ct_rune_t. */ __BEGIN_DECLS -unsigned long ___runetype(_BSD_CT_RUNE_T_); -_BSD_CT_RUNE_T_ ___tolower(_BSD_CT_RUNE_T_); -_BSD_CT_RUNE_T_ ___toupper(_BSD_CT_RUNE_T_); +unsigned long ___runetype(__ct_rune_t); +__ct_rune_t ___tolower(__ct_rune_t); +__ct_rune_t ___toupper(__ct_rune_t); __END_DECLS /* @@ -149,34 +149,34 @@ __END_DECLS #if !defined(_DONT_USE_CTYPE_INLINE_) && \ (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) static __inline int -__maskrune(_BSD_CT_RUNE_T_ _c, unsigned long _f) +__maskrune(__ct_rune_t _c, unsigned long _f) { return ((_c < 0 || _c >= _CACHED_RUNES) ? ___runetype(_c) : _CurrentRuneLocale->runetype[_c]) & _f; } static __inline int -__istype(_BSD_CT_RUNE_T_ _c, unsigned long _f) +__istype(__ct_rune_t _c, unsigned long _f) { return (!!__maskrune(_c, _f)); } static __inline int -__isctype(_BSD_CT_RUNE_T_ _c, unsigned long _f) +__isctype(__ct_rune_t _c, unsigned long _f) { return (_c < 0 || _c >= _CACHED_RUNES) ? 0 : !!(_DefaultRuneLocale.runetype[_c] & _f); } -static __inline _BSD_CT_RUNE_T_ -__toupper(_BSD_CT_RUNE_T_ _c) +static __inline __ct_rune_t +__toupper(__ct_rune_t _c) { return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) : _CurrentRuneLocale->mapupper[_c]; } -static __inline _BSD_CT_RUNE_T_ -__tolower(_BSD_CT_RUNE_T_ _c) +static __inline __ct_rune_t +__tolower(__ct_rune_t _c) { return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) : _CurrentRuneLocale->maplower[_c]; @@ -185,11 +185,11 @@ __tolower(_BSD_CT_RUNE_T_ _c) #else /* not using inlines */ __BEGIN_DECLS -int __maskrune(_BSD_CT_RUNE_T_, unsigned long); -int __istype(_BSD_CT_RUNE_T_, unsigned long); -int __isctype(_BSD_CT_RUNE_T_, unsigned long); -_BSD_CT_RUNE_T_ __toupper(_BSD_CT_RUNE_T_); -_BSD_CT_RUNE_T_ __tolower(_BSD_CT_RUNE_T_); +int __maskrune(__ct_rune_t, unsigned long); +int __istype(__ct_rune_t, unsigned long); +int __isctype(__ct_rune_t, unsigned long); +__ct_rune_t __toupper(__ct_rune_t); +__ct_rune_t __tolower(__ct_rune_t); __END_DECLS #endif /* using inlines */ diff --git a/include/arpa/inet.h b/include/arpa/inet.h index 13be871..41cbc11 100644 --- a/include/arpa/inet.h +++ b/include/arpa/inet.h @@ -59,7 +59,7 @@ /* External definitions for functions in inet(3), addr2ascii(3) */ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> /* Required for byteorder(3) functions. */ #include <machine/endian.h> @@ -88,9 +88,9 @@ typedef uint16_t in_port_t; #endif #if __BSD_VISIBLE -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif #endif @@ -98,9 +98,9 @@ typedef _BSD_SIZE_T_ size_t; * XXX socklen_t is used by a POSIX.1-2001 interface, but not required by * POSIX.1-2001. */ -#ifdef _BSD_SOCKLEN_T_ -typedef _BSD_SOCKLEN_T_ socklen_t; -#undef _BSD_SOCKLEN_T_ +#ifndef _SOCKLEN_T_DECLARED +typedef __socklen_t socklen_t; +#define _SOCKLEN_T_DECLARED #endif #ifndef _STRUCT_IN_ADDR_DECLARED diff --git a/include/ctype.h b/include/ctype.h index 15a5b227..e3d574d 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -126,11 +126,11 @@ __END_DECLS #define toascii(c) ((c) & 0x7F) #endif -/* See comments in <machine/ansi.h> about _BSD_CT_RUNE_T_. */ +/* See comments in <machine/_types.h> about __ct_rune_t. */ __BEGIN_DECLS -unsigned long ___runetype(_BSD_CT_RUNE_T_); -_BSD_CT_RUNE_T_ ___tolower(_BSD_CT_RUNE_T_); -_BSD_CT_RUNE_T_ ___toupper(_BSD_CT_RUNE_T_); +unsigned long ___runetype(__ct_rune_t); +__ct_rune_t ___tolower(__ct_rune_t); +__ct_rune_t ___toupper(__ct_rune_t); __END_DECLS /* @@ -149,34 +149,34 @@ __END_DECLS #if !defined(_DONT_USE_CTYPE_INLINE_) && \ (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) static __inline int -__maskrune(_BSD_CT_RUNE_T_ _c, unsigned long _f) +__maskrune(__ct_rune_t _c, unsigned long _f) { return ((_c < 0 || _c >= _CACHED_RUNES) ? ___runetype(_c) : _CurrentRuneLocale->runetype[_c]) & _f; } static __inline int -__istype(_BSD_CT_RUNE_T_ _c, unsigned long _f) +__istype(__ct_rune_t _c, unsigned long _f) { return (!!__maskrune(_c, _f)); } static __inline int -__isctype(_BSD_CT_RUNE_T_ _c, unsigned long _f) +__isctype(__ct_rune_t _c, unsigned long _f) { return (_c < 0 || _c >= _CACHED_RUNES) ? 0 : !!(_DefaultRuneLocale.runetype[_c] & _f); } -static __inline _BSD_CT_RUNE_T_ -__toupper(_BSD_CT_RUNE_T_ _c) +static __inline __ct_rune_t +__toupper(__ct_rune_t _c) { return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) : _CurrentRuneLocale->mapupper[_c]; } -static __inline _BSD_CT_RUNE_T_ -__tolower(_BSD_CT_RUNE_T_ _c) +static __inline __ct_rune_t +__tolower(__ct_rune_t _c) { return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) : _CurrentRuneLocale->maplower[_c]; @@ -185,11 +185,11 @@ __tolower(_BSD_CT_RUNE_T_ _c) #else /* not using inlines */ __BEGIN_DECLS -int __maskrune(_BSD_CT_RUNE_T_, unsigned long); -int __istype(_BSD_CT_RUNE_T_, unsigned long); -int __isctype(_BSD_CT_RUNE_T_, unsigned long); -_BSD_CT_RUNE_T_ __toupper(_BSD_CT_RUNE_T_); -_BSD_CT_RUNE_T_ __tolower(_BSD_CT_RUNE_T_); +int __maskrune(__ct_rune_t, unsigned long); +int __istype(__ct_rune_t, unsigned long); +int __isctype(__ct_rune_t, unsigned long); +__ct_rune_t __toupper(__ct_rune_t); +__ct_rune_t __tolower(__ct_rune_t); __END_DECLS #endif /* using inlines */ diff --git a/include/err.h b/include/err.h index e829e9a..675c708 100644 --- a/include/err.h +++ b/include/err.h @@ -42,25 +42,25 @@ * places (<machine/varargs.h> and <machine/stdarg.h>), 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 <machine/ansi.h> and use it. + * __va_list from <sys/_types.h> and use it. */ -#include <machine/ansi.h> #include <sys/cdefs.h> +#include <sys/_types.h> __BEGIN_DECLS void err(int, const char *, ...) __dead2 __printf0like(2, 3); -void verr(int, const char *, _BSD_VA_LIST_) __dead2 __printf0like(2, 0); +void verr(int, const char *, __va_list) __dead2 __printf0like(2, 0); void errc(int, int, const char *, ...) __dead2 __printf0like(3, 4); -void verrc(int, int, const char *, _BSD_VA_LIST_) __dead2 +void verrc(int, int, const char *, __va_list) __dead2 __printf0like(3, 0); void errx(int, const char *, ...) __dead2 __printf0like(2, 3); -void verrx(int, const char *, _BSD_VA_LIST_) __dead2 __printf0like(2, 0); +void verrx(int, const char *, __va_list) __dead2 __printf0like(2, 0); void warn(const char *, ...) __printf0like(1, 2); -void vwarn(const char *, _BSD_VA_LIST_) __printf0like(1, 0); +void vwarn(const char *, __va_list) __printf0like(1, 0); void warnc(int, const char *, ...) __printf0like(2, 3); -void vwarnc(int, const char *, _BSD_VA_LIST_) __printf0like(2, 0); +void vwarnc(int, const char *, __va_list) __printf0like(2, 0); void warnx(const char *, ...) __printflike(1, 2); -void vwarnx(const char *, _BSD_VA_LIST_) __printflike(1, 0); +void vwarnx(const char *, __va_list) __printflike(1, 0); void err_set_file(void *); void err_set_exit(void (*)(int)); __END_DECLS diff --git a/include/grp.h b/include/grp.h index ce69823..2f5c543 100644 --- a/include/grp.h +++ b/include/grp.h @@ -49,9 +49,9 @@ #define _PATH_GROUP "/etc/group" #endif -#ifdef _BSD_GID_T_ -typedef _BSD_GID_T_ gid_t; -#undef _BSD_GID_T_ +#ifndef _GID_T_DECLARED +typedef __gid_t gid_t; +#define _GID_T_DECLARED #endif struct group { diff --git a/include/inttypes.h b/include/inttypes.h index d2b86dd..3fe6fcc 100644 --- a/include/inttypes.h +++ b/include/inttypes.h @@ -33,9 +33,9 @@ #include <sys/stdint.h> #ifndef __cplusplus -#ifdef _BSD_WCHAR_T_ -typedef _BSD_WCHAR_T_ wchar_t; -#undef _BSD_WCHAR_T_ +#ifndef _WCHAR_T_DECLARED +typedef __wchar_t wchar_t; +#define _WCHAR_T_DECLARED #endif #endif diff --git a/include/monetary.h b/include/monetary.h index 1de844b..9601078 100644 --- a/include/monetary.h +++ b/include/monetary.h @@ -30,16 +30,16 @@ #define _MONETARY_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif -#ifdef _BSD_SSIZE_T_ -typedef _BSD_SSIZE_T_ ssize_t; -#undef _BSD_SSIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __ssize_t ssize_t; +#define _SIZE_T_DECLARED #endif __BEGIN_DECLS diff --git a/include/netdb.h b/include/netdb.h index 8da2e8d..4fb0aa8 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -62,16 +62,16 @@ #define _NETDB_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif -#ifdef _BSD_SOCKLEN_T_ -typedef _BSD_SOCKLEN_T_ socklen_t; -#undef _BSD_SOCKLEN_T_ +#ifndef _SOCKLEN_T_DECLARED +typedef __socklen_t socklen_t; +#define _SOCKLEN_T_DECLARED #endif #ifndef _PATH_HEQUIV diff --git a/include/pwd.h b/include/pwd.h index b038fa7..40082c3 100644 --- a/include/pwd.h +++ b/include/pwd.h @@ -45,19 +45,19 @@ #include <sys/cdefs.h> #include <sys/_types.h> -#ifdef _BSD_GID_T_ -typedef _BSD_GID_T_ gid_t; -#undef _BSD_GID_T_ +#ifndef _GID_T_DECLARED +typedef __gid_t gid_t; +#define _GID_T_DECLARED #endif -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ +#ifndef _TIME_T_DECLARED +typedef __time_t time_t; +#define _TIME_T_DECLARED #endif -#ifdef _BSD_UID_T_ -typedef _BSD_UID_T_ uid_t; -#undef _BSD_UID_T_ +#ifndef _UID_T_DECLARED +typedef __uid_t uid_t; +#define _UID_T_DECLARED #endif #define _PATH_PWD "/etc" diff --git a/include/runetype.h b/include/runetype.h index 4ddd95d..522206d 100644 --- a/include/runetype.h +++ b/include/runetype.h @@ -41,22 +41,22 @@ #define _RUNETYPE_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> -#ifdef _BSD_RUNE_T_ -typedef _BSD_RUNE_T_ rune_t; -#undef _BSD_RUNE_T_ +#ifndef _RUNE_T_DECLARED +typedef __rune_t rune_t; +#define _RUNE_T_DECLARED #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif #ifndef __cplusplus -#ifdef _BSD_WCHAR_T_ -typedef _BSD_WCHAR_T_ wchar_t; -#undef _BSD_WCHAR_T_ +#ifndef _WCHAR_T_DECLARED +typedef __wchar_t wchar_t; +#define _WCHAR_T_DECLARED #endif #endif diff --git a/include/search.h b/include/search.h index f0ef443..c899762 100644 --- a/include/search.h +++ b/include/search.h @@ -10,11 +10,11 @@ #define _SEARCH_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif typedef struct entry { diff --git a/include/signal.h b/include/signal.h index 58ff0f8..ec6e5a0 100644 --- a/include/signal.h +++ b/include/signal.h @@ -40,7 +40,7 @@ #include <sys/cdefs.h> #include <sys/_posix.h> -#include <machine/ansi.h> +#include <sys/_types.h> #include <sys/signal.h> #include <sys/time.h> @@ -53,7 +53,7 @@ extern __const int sys_nsig; __BEGIN_DECLS int raise(int); #ifndef _ANSI_SOURCE -int kill(_BSD_PID_T_, int); +int kill(__pid_t, int); int sigaction(int, const struct sigaction *, struct sigaction *); int sigaddset(sigset_t *, int); int sigdelset(sigset_t *, int); @@ -69,14 +69,14 @@ int sigwait(const sigset_t *, int *); #ifdef _P1003_1B_VISIBLE __BEGIN_DECLS -int sigqueue(_BSD_PID_T_, int, const union sigval); +int sigqueue(__pid_t, int, const union sigval); int sigtimedwait(const sigset_t *, siginfo_t *, const struct timespec *); int sigwaitinfo(const sigset_t *, siginfo_t *); __END_DECLS #endif #ifndef _POSIX_SOURCE -int killpg(_BSD_PID_T_, int); +int killpg(__pid_t, int); int sigaltstack(const stack_t *, stack_t *); int sigblock(int); int siginterrupt(int, int); diff --git a/include/stddef.h b/include/stddef.h index 1e8dd2e..8400214 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -39,26 +39,26 @@ #define _STDDEF_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> -typedef _BSD_PTRDIFF_T_ ptrdiff_t; +typedef __ptrdiff_t ptrdiff_t; #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) -#ifdef _BSD_RUNE_T_ -typedef _BSD_RUNE_T_ rune_t; -#undef _BSD_RUNE_T_ +#ifndef _RUNE_T_DECLARED +typedef __rune_t rune_t; +#define _RUNE_T_DECLARED #endif #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif #ifndef __cplusplus -#ifdef _BSD_WCHAR_T_ -typedef _BSD_WCHAR_T_ wchar_t; -#undef _BSD_WCHAR_T_ +#ifndef _WCHAR_T_DECLARED +typedef __wchar_t wchar_t; +#define _WCHAR_T_DECLARED #endif #endif diff --git a/include/stdio.h b/include/stdio.h index d64e690..724b0df 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -41,18 +41,18 @@ #define _STDIO_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif #ifndef NULL #define NULL 0 #endif -typedef _BSD_OFF_T_ fpos_t; +typedef __off_t fpos_t; #define _FSTDIO /* Define for new stdio with functions. */ @@ -251,16 +251,16 @@ FILE *tmpfile(void); char *tmpnam(char *); int ungetc(int, FILE *); int vfprintf(FILE *__restrict, const char *__restrict, - _BSD_VA_LIST_); -int vprintf(const char *__restrict, _BSD_VA_LIST_); + __va_list); +int vprintf(const char *__restrict, __va_list); int vsprintf(char *__restrict, const char *__restrict, - _BSD_VA_LIST_); + __va_list); #if __ISO_C_VISIBLE >= 1999 int snprintf(char *__restrict, size_t, const char *__restrict, ...) __printflike(3, 4); int vsnprintf(char *__restrict, size_t, const char *__restrict, - _BSD_VA_LIST_) __printflike(3, 0); + __va_list) __printflike(3, 0); #endif /* @@ -298,8 +298,8 @@ int putchar_unlocked(int); #endif #if __POSIX_VISIBLE >= 200112 -int fseeko(FILE *, _BSD_OFF_T_, int); -_BSD_OFF_T_ ftello(FILE *); +int fseeko(FILE *, __off_t, int); +__off_t ftello(FILE *); #endif #if __BSD_VISIBLE || __XSI_VISIBLE > 0 && __XSI_VISIBLE < 600 @@ -327,10 +327,10 @@ __const char *fmtcheck(const char *, const char *) __ATTR_FORMAT_ARG; int fpurge(FILE *); void setbuffer(FILE *, char *, int); int setlinebuf(FILE *); -int vasprintf(char **, const char *, _BSD_VA_LIST_) +int vasprintf(char **, const char *, __va_list) __printflike(2, 0); -int vscanf(const char *, _BSD_VA_LIST_) __scanflike(1, 0); -int vsscanf(const char *, const char *, _BSD_VA_LIST_) +int vscanf(const char *, __va_list) __scanflike(1, 0); +int vsscanf(const char *, const char *, __va_list) __scanflike(2, 0); /* @@ -364,19 +364,19 @@ FILE *funopen(const void *, */ #ifndef _FTRUNCATE_DECLARED #define _FTRUNCATE_DECLARED -int ftruncate(int, _BSD_OFF_T_); +int ftruncate(int, __off_t); #endif #ifndef _LSEEK_DECLARED #define _LSEEK_DECLARED -_BSD_OFF_T_ lseek(int, _BSD_OFF_T_, int); +__off_t lseek(int, __off_t, int); #endif #ifndef _MMAP_DECLARED #define _MMAP_DECLARED -void *mmap(void *, size_t, int, int, int, _BSD_OFF_T_); +void *mmap(void *, size_t, int, int, int, __off_t); #endif #ifndef _TRUNCATE_DECLARED #define _TRUNCATE_DECLARED -int truncate(const char *, _BSD_OFF_T_); +int truncate(const char *, __off_t); #endif #endif /* __BSD_VISIBLE */ @@ -384,8 +384,8 @@ int truncate(const char *, _BSD_OFF_T_); * Functions internal to the implementation. */ int __srget(FILE *); -int __vfscanf(FILE *, const char *, _BSD_VA_LIST_); -int __svfscanf(FILE *, const char *, _BSD_VA_LIST_); +int __vfscanf(FILE *, const char *, __va_list); +int __svfscanf(FILE *, const char *, __va_list); int __swbuf(int, FILE *); /* diff --git a/include/stdlib.h b/include/stdlib.h index c3c3cc0..c3d9d13 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -38,25 +38,24 @@ #define _STDLIB_H_ #include <sys/cdefs.h> - -#include <machine/ansi.h> +#include <sys/_types.h> #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) -#ifdef _BSD_RUNE_T_ -typedef _BSD_RUNE_T_ rune_t; -#undef _BSD_RUNE_T_ +#ifndef _RUNE_T_DECLARED +typedef __rune_t rune_t; +#define _RUNE_T_DECLARED #endif #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif #ifndef __cplusplus -#ifdef _BSD_WCHAR_T_ -typedef _BSD_WCHAR_T_ wchar_t; -#undef _BSD_WCHAR_T_ +#ifndef _WCHAR_T_DECLARED +typedef __wchar_t wchar_t; +#define _WCHAR_T_DECLARED #endif #endif diff --git a/include/string.h b/include/string.h index 7b3dbc6..7715991 100644 --- a/include/string.h +++ b/include/string.h @@ -38,7 +38,7 @@ #define _STRING_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> /* * Prototype functions which were historically defined in <string.h>, but @@ -48,9 +48,9 @@ #include <strings.h> #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif #ifndef NULL diff --git a/include/strings.h b/include/strings.h index bc989cb..cb77938 100644 --- a/include/strings.h +++ b/include/strings.h @@ -30,11 +30,11 @@ #define _STRINGS_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif __BEGIN_DECLS diff --git a/include/time.h b/include/time.h index daf8e90..c317a98 100644 --- a/include/time.h +++ b/include/time.h @@ -46,6 +46,8 @@ #define _TIME_H_ #include <sys/cdefs.h> +#include <sys/_types.h> + #include <machine/ansi.h> #if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE @@ -63,33 +65,33 @@ #define NULL 0 #endif -#ifdef _BSD_CLOCK_T_ -typedef _BSD_CLOCK_T_ clock_t; -#undef _BSD_CLOCK_T_ +#ifndef _CLOCK_T_DECLARED +typedef __clock_t clock_t; +#define _CLOCK_T_DECLARED #endif -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ +#ifndef _TIME_T_DECLARED +typedef __time_t time_t; +#define _TIME_T_DECLARED #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif #if __POSIX_VISIBLE >= 199309 /* * New in POSIX 1003.1b-1993. */ -#ifdef _BSD_CLOCKID_T_ -typedef _BSD_CLOCKID_T_ clockid_t; -#undef _BSD_CLOCKID_T_ +#ifndef _CLOCKID_T_DECLARED +typedef __clockid_t clockid_t; +#define _CLOCKID_T_DECLARED #endif -#ifdef _BSD_TIMER_T_ -typedef _BSD_TIMER_T_ timer_t; -#undef _BSD_TIMER_T_ +#ifndef _TIMER_T_DECLARED +typedef __timer_t timer_t; +#define _TIMER_T_DECLARED #endif #include <sys/timespec.h> diff --git a/include/timeconv.h b/include/timeconv.h index e76c4cd..cce937c 100644 --- a/include/timeconv.h +++ b/include/timeconv.h @@ -46,11 +46,11 @@ #define _TIMECONV_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ +#ifndef _TIME_T_DECLARED +typedef __time_t time_t; +#define _TIME_T_DECLARED #endif time_t _time32_to_time(__int32_t t32); diff --git a/include/unistd.h b/include/unistd.h index 099cf53..8629305 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -42,24 +42,24 @@ #include <sys/unistd.h> #include <sys/_types.h> -#ifdef _BSD_GID_T_ -typedef _BSD_GID_T_ gid_t; -#undef _BSD_GID_T_ +#ifndef _GID_T_DECLARED +typedef __gid_t gid_t; +#define _GID_T_DECLARED #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif -#ifdef _BSD_SSIZE_T_ -typedef _BSD_SSIZE_T_ ssize_t; -#undef _BSD_SSIZE_T_ +#ifndef _SSIZE_T_DECLARED +typedef __ssize_t ssize_t; +#define _SSIZE_T_DECLARED #endif -#ifdef _BSD_UID_T_ -typedef _BSD_UID_T_ uid_t; -#undef _BSD_UID_T_ +#ifndef _UID_T_DECLARED +typedef __uid_t_ uid_t; +#define _UID_T_DECLARED #endif /* diff --git a/include/vis.h b/include/vis.h index f630db7..d4134db 100644 --- a/include/vis.h +++ b/include/vis.h @@ -37,11 +37,11 @@ #ifndef _VIS_H_ #define _VIS_H_ -#include <machine/ansi.h> +#include <sys/_types.h> -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif /* diff --git a/include/wchar.h b/include/wchar.h index 36785ca..bcbac9b 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -68,7 +68,7 @@ #define _WCHAR_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> #include <stdio.h> @@ -76,20 +76,20 @@ #define NULL 0 #endif -#ifdef _BSD_MBSTATE_T_ -typedef _BSD_MBSTATE_T_ mbstate_t; -#undef _BSD_MBSTATE_T_ +#ifndef _MBSTATE_T_DECLARED +typedef __mbstate_t mbstate_t; +#define _MBSTATE_T_DECLARED #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif #ifndef __cplusplus -#ifdef _BSD_WCHAR_T_ -typedef _BSD_WCHAR_T_ wchar_t; -#undef _BSD_WCHAR_T_ +#ifndef _WCHAR_T_DECLARED +typedef __wchar_t wchar_t; +#define _WCHAR_T_DECLARED #endif #endif @@ -98,9 +98,9 @@ typedef unsigned long wctype_t; #define _WCTYPE_T #endif -#ifdef _BSD_WINT_T_ -typedef _BSD_WINT_T_ wint_t; -#undef _BSD_WINT_T_ +#ifndef _WINT_T_DECLARED +typedef __wint_t wint_t; +#define _WINT_T_DECLARED #endif #ifndef WEOF diff --git a/include/wctype.h b/include/wctype.h index 2865184..359cc3b 100644 --- a/include/wctype.h +++ b/include/wctype.h @@ -32,7 +32,7 @@ #define _WCTYPE_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> #include <ctype.h> @@ -46,9 +46,9 @@ typedef unsigned long wctype_t; #define _WCTYPE_T #endif -#ifdef _BSD_WINT_T_ -typedef _BSD_WINT_T_ wint_t; -#undef _BSD_WINT_T_ +#ifndef _WINT_T_DECLARED +typedef __wint_t wint_t; +#define _WINT_T_DECLARED #endif #ifndef WEOF diff --git a/lib/libc/locale/runetype.c b/lib/libc/locale/runetype.c index a2ee9e6..ec1c2ec 100644 --- a/lib/libc/locale/runetype.c +++ b/lib/libc/locale/runetype.c @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); unsigned long ___runetype(c) - _BSD_CT_RUNE_T_ c; + __ct_rune_t c; { int x; _RuneRange *rr = &_CurrentRuneLocale->runetype_ext; diff --git a/lib/libc/locale/tolower.c b/lib/libc/locale/tolower.c index 42392d7..f8caecb 100644 --- a/lib/libc/locale/tolower.c +++ b/lib/libc/locale/tolower.c @@ -40,9 +40,9 @@ __FBSDID("$FreeBSD$"); #include <stdio.h> #include <rune.h> -_BSD_CT_RUNE_T_ +__ct_rune_t ___tolower(c) - _BSD_CT_RUNE_T_ c; + __ct_rune_t c; { int x; _RuneRange *rr = &_CurrentRuneLocale->maplower_ext; diff --git a/lib/libc/locale/toupper.c b/lib/libc/locale/toupper.c index 1871f8a..6ce6757 100644 --- a/lib/libc/locale/toupper.c +++ b/lib/libc/locale/toupper.c @@ -40,9 +40,9 @@ __FBSDID("$FreeBSD$"); #include <stdio.h> #include <rune.h> -_BSD_CT_RUNE_T_ +__ct_rune_t ___toupper(c) - _BSD_CT_RUNE_T_ c; + __ct_rune_t c; { int x; _RuneRange *rr = &_CurrentRuneLocale->mapupper_ext; diff --git a/lib/libc/stdio/local.h b/lib/libc/stdio/local.h index 4d8926a..bfa4aab 100644 --- a/lib/libc/stdio/local.h +++ b/lib/libc/stdio/local.h @@ -69,7 +69,7 @@ extern int _fwalk(int (*)(FILE *)); extern int __swsetup(FILE *); extern int __sflags(const char *, int *); extern int __ungetc(int, FILE *); -extern int __vfprintf(FILE *, const char *, _BSD_VA_LIST_); +extern int __vfprintf(FILE *, const char *, __va_list); extern int __sdidinit; diff --git a/lib/libc/stdio/vasprintf.c b/lib/libc/stdio/vasprintf.c index 9d55725..9e8efcf 100644 --- a/lib/libc/stdio/vasprintf.c +++ b/lib/libc/stdio/vasprintf.c @@ -39,7 +39,7 @@ int vasprintf(str, fmt, ap) char **str; const char *fmt; - _BSD_VA_LIST_ ap; + __va_list ap; { int ret; FILE f; diff --git a/lib/libc/stdio/vprintf.c b/lib/libc/stdio/vprintf.c index 1f293d6..253870c 100644 --- a/lib/libc/stdio/vprintf.c +++ b/lib/libc/stdio/vprintf.c @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include <stdio.h> int -vprintf(const char *__restrict fmt, _BSD_VA_LIST_ ap) +vprintf(const char *__restrict fmt, __va_list ap) { return (vfprintf(stdout, fmt, ap)); diff --git a/lib/libc/stdio/vscanf.c b/lib/libc/stdio/vscanf.c index beed0c2..92f55fc 100644 --- a/lib/libc/stdio/vscanf.c +++ b/lib/libc/stdio/vscanf.c @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); int vscanf(fmt, ap) const char *fmt; - _BSD_VA_LIST_ ap; + __va_list ap; { int retval; diff --git a/lib/libc/stdio/vsnprintf.c b/lib/libc/stdio/vsnprintf.c index eae9adc..7f18c83 100644 --- a/lib/libc/stdio/vsnprintf.c +++ b/lib/libc/stdio/vsnprintf.c @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); int vsnprintf(char *__restrict str, size_t n, const char *__restrict fmt, - _BSD_VA_LIST_ ap) + __va_list ap) { size_t on; int ret; diff --git a/lib/libc/stdio/vsprintf.c b/lib/libc/stdio/vsprintf.c index b66b7c8..82e6297 100644 --- a/lib/libc/stdio/vsprintf.c +++ b/lib/libc/stdio/vsprintf.c @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include "local.h" int -vsprintf(char *__restrict str, const char *__restrict fmt, _BSD_VA_LIST_ ap) +vsprintf(char *__restrict str, const char *__restrict fmt, __va_list ap) { int ret; FILE f; diff --git a/lib/libc/stdio/vsscanf.c b/lib/libc/stdio/vsscanf.c index 58778f6..81a241c 100644 --- a/lib/libc/stdio/vsscanf.c +++ b/lib/libc/stdio/vsscanf.c @@ -62,7 +62,7 @@ int vsscanf(str, fmt, ap) const char *str; const char *fmt; - _BSD_VA_LIST_ ap; + __va_list ap; { FILE f; struct __sFILEX ext; diff --git a/lib/libdevinfo/devinfo.h b/lib/libdevinfo/devinfo.h index 3d978d3..63188aa 100644 --- a/lib/libdevinfo/devinfo.h +++ b/lib/libdevinfo/devinfo.h @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> typedef __uintptr_t devinfo_handle_t; #define DEVINFO_ROOT_DEVICE ((devinfo_handle_t)0) diff --git a/lib/libkvm/kvm.h b/lib/libkvm/kvm.h index 9bf4975..034432e 100644 --- a/lib/libkvm/kvm.h +++ b/lib/libkvm/kvm.h @@ -38,21 +38,21 @@ #define _KVM_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> #include <nlist.h> /* Default version symbol. */ #define VRS_SYM "_version" #define VRS_KEY "VERSION" -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif -#ifdef _BSD_SSIZE_T_ -typedef _BSD_SSIZE_T_ ssize_t; -#undef _BSD_SSIZE_T_ +#ifndef _SSIZE_T_DECLARED +typedef __ssize_t ssize_t; +#define _SSIZE_T_DECLARED #endif typedef struct __kvm kvm_t; diff --git a/lib/libncurses/Makefile b/lib/libncurses/Makefile index 92611f6..f024b91 100644 --- a/lib/libncurses/Makefile +++ b/lib/libncurses/Makefile @@ -386,8 +386,8 @@ curses.head: curses.h.in -e "s%@cf_cv_type_of_bool@%${TYPE_OF_BOOL}%g" \ -e "s%@cf_cv_typeof_chtype@%${TYPEOF_CHTYPE}%g" \ -e "s%@cf_cv_widec_shift@%${WIDEC_SHIFT}%g" \ - -e "s/ _WCHAR_T/ _BSD_WCHAR_T_/g" \ - -e "s/ _WINT_T/ _BSD_WINT_T_/g" \ + -e "s/ _WCHAR_T/ __wchar_t/g" \ + -e "s/ _WINT_T/ __wint_t/g" \ unctrl.h: unctrl.h.in sed <${NCURSES}/include/$@.in >$@ \ diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h index 44656df..40455fa 100644 --- a/lib/libstand/stand.h +++ b/lib/libstand/stand.h @@ -245,9 +245,9 @@ struct disklabel; extern char *getdisklabel(const char *, struct disklabel *); extern int printf(const char *fmt, ...) __printflike(1, 2); -extern void vprintf(const char *fmt, _BSD_VA_LIST_); +extern void vprintf(const char *fmt, __va_list); extern int sprintf(char *buf, const char *cfmt, ...) __printflike(2, 3); -extern void vsprintf(char *buf, const char *cfmt, _BSD_VA_LIST_); +extern void vsprintf(char *buf, const char *cfmt, __va_list); extern void twiddle(void); diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index 92611f6..f024b91 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -386,8 +386,8 @@ curses.head: curses.h.in -e "s%@cf_cv_type_of_bool@%${TYPE_OF_BOOL}%g" \ -e "s%@cf_cv_typeof_chtype@%${TYPEOF_CHTYPE}%g" \ -e "s%@cf_cv_widec_shift@%${WIDEC_SHIFT}%g" \ - -e "s/ _WCHAR_T/ _BSD_WCHAR_T_/g" \ - -e "s/ _WINT_T/ _BSD_WINT_T_/g" \ + -e "s/ _WCHAR_T/ __wchar_t/g" \ + -e "s/ _WINT_T/ __wint_t/g" \ unctrl.h: unctrl.h.in sed <${NCURSES}/include/$@.in >$@ \ diff --git a/sys/alpha/include/_types.h b/sys/alpha/include/_types.h new file mode 100644 index 0000000..9669323 --- /dev/null +++ b/sys/alpha/include/_types.h @@ -0,0 +1,147 @@ +/*- + * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> + * 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 + * 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: @(#)ansi.h 8.2 (Berkeley) 1/4/94 + * From: @(#)types.h 8.3 (Berkeley) 1/5/94 + * $FreeBSD$ + */ + +#ifndef _MACHINE__TYPES_H_ +#define _MACHINE__TYPES_H_ + +/* + * Basic types upon which most other types are built. + */ +typedef __signed char __int8_t; +typedef unsigned char __uint8_t; +typedef short __int16_t; +typedef unsigned short __uint16_t; +typedef int __int32_t; +typedef unsigned int __uint32_t; +typedef long __int64_t; +typedef unsigned long __uint64_t; + +/* + * Standard type definitions. + */ +typedef __int32_t __clock_t; /* clock()... */ +typedef __int32_t __clockid_t; /* clock_gettime()... */ +typedef __int64_t __critical_t; +typedef __uint32_t __fflags_t; /* file flags */ +typedef __int64_t __intfptr_t; +typedef __int64_t __intmax_t; +typedef __int64_t __intptr_t; +typedef __uint32_t __intrmask_t; +typedef __int32_t __int_fast8_t; +typedef __int32_t __int_fast16_t; +typedef __int32_t __int_fast32_t; +typedef __int64_t __int_fast64_t; +typedef __int8_t __int_least8_t; +typedef __int16_t __int_least16_t; +typedef __int32_t __int_least32_t; +typedef __int64_t __int_least64_t; +typedef __int64_t __off_t; /* file offset */ +typedef __int32_t __pid_t; /* process [group] */ +typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ +typedef __int64_t __register_t; +typedef __int64_t __segsz_t; /* segment size (in pages) */ +typedef __uint64_t __size_t; /* sizeof() */ +typedef __uint32_t __socklen_t; +typedef __int64_t __ssize_t; /* byte count or error */ +typedef __int32_t __time_t; /* time()... */ +typedef __int32_t __timer_t; /* timer_gettime()... */ +typedef __uint64_t __uintfptr_t; +typedef __uint64_t __uintmax_t; +typedef __uint64_t __uintptr_t; +typedef __uint32_t __uint_fast8_t; +typedef __uint32_t __uint_fast16_t; +typedef __uint32_t __uint_fast32_t; +typedef __uint64_t __uint_fast64_t; +typedef __uint8_t __uint_least8_t; +typedef __uint16_t __uint_least16_t; +typedef __uint32_t __uint_least32_t; +typedef __uint64_t __uint_least64_t; +typedef __uint64_t __u_register_t; +typedef __uint64_t __vm_offset_t; +typedef __int64_t __vm_ooffset_t; +typedef __uint64_t __vm_pindex_t; +typedef __uint64_t __vm_size_t; + +/* + * Unusual type definitions. + */ +/* + * The rune type above 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 __ct_rune_t instead of int. By changing it here, you + * lose a bit of ANSI conformance, but your programs will still work. + * + * NOTE: rune_t is not covered by ANSI nor other standards, and should not + * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and + * rune_t must be the same type. Also wint_t must be no narrower than + * wchar_t, and should also be able to hold all members of the largest + * character set plus one extra value (WEOF). wint_t must be at least 16 bits. + */ +typedef __int32_t __ct_rune_t; +typedef __int32_t __rune_t; +typedef __int32_t __wchar_t; +typedef __int32_t __wint_t; + +/* + * mbstate_t is an opaque object to keep conversion state, during multibyte + * stream conversions. The content must not be referenced by user programs. + */ +typedef union { + char __mbstate8[128]; + __int64_t _mbstateL; /* for alignment */ +} __mbstate_t; + +#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) +typedef __builtin_va_list __va_list; /* internally known to gcc */ +#else +typedef struct { + char *__base; + int __offset; + int __pad; +} __va_list; +#endif /* post GCC 2.95 */ +#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST) +#define __GNUC_VA_LIST +typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ +#endif + +#endif /* !_MACHINE__TYPES_H_ */ diff --git a/sys/alpha/include/ansi.h b/sys/alpha/include/ansi.h index d9e4022..11dbf03 100644 --- a/sys/alpha/include/ansi.h +++ b/sys/alpha/include/ansi.h @@ -39,73 +39,6 @@ #define _MACHINE_ANSI_H_ /* - * Types which are fundamental to the implementation and may appear in - * more than one standard header are defined here. Standard headers - * then use: - * #ifdef _BSD_SIZE_T_ - * typedef _BSD_SIZE_T_ size_t; - * #undef _BSD_SIZE_T_ - * #endif - */ -#define _BSD_CLOCK_T_ int /* clock() */ -#define _BSD_CLOCKID_T_ int /* clock_gettime()... */ -#define _BSD_FFLAGS_T_ __uint_least32_t /* file flags */ -#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */ -#define _BSD_PTRDIFF_T_ long /* ptr1 - ptr2 */ -#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */ -#define _BSD_SEGSZ_T_ __int64_t /* segment size (in pages) */ -#define _BSD_SIZE_T_ unsigned long /* sizeof() */ -#define _BSD_SOCKLEN_T_ __uint32_t /* socklen_t (duh) */ -#define _BSD_SSIZE_T_ long /* byte count or error */ -#define _BSD_TIME_T_ int /* time()... */ -#define _BSD_TIMER_T_ int /* timer_gettime()... */ -#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */ -#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t (see below) */ - -/* - * Types which are fundamental to the implementation and must be used - * in more than one standard header although they are only declared in - * one (perhaps nonstandard) header are defined here. Standard headers - * use _BSD_XXX_T_ without undef'ing it. - */ -#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */ -#define _BSD_OFF_T_ long /* file offset */ -#define _BSD_PID_T_ int /* process [group] */ - -#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) -#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */ -#else -typedef struct { - char *__base; - int __offset; - int __pad; -} __va_list; -#define _BSD_VA_LIST_ __va_list /* va_list */ -#endif /* post GCC 2.95 */ -#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - -/* - * The rune type above 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 _BSD_CT_RUNE_T_ instead of int. By changing it - * here, you lose a bit of ANSI conformance, but your programs will still - * work. - * - * NOTE: rune_t is not covered by ANSI nor other standards, and should not - * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and - * rune_t must be the same type. Also wint_t must be no narrower than - * wchar_t, and should also be able to hold all members of the largest - * character set plus one extra value (WEOF). wint_t must be at least 16 bits. - */ - -/* * Frequencies of the clock ticks reported by clock() and times(). They * are the same as stathz for bogus historical reasons. They should be * 1e6 because clock() and times() are implemented using getrusage() and @@ -118,50 +51,4 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ #define _BSD_CLK_TCK_ 100 #define _BSD_CLOCKS_PER_SEC_ 100 -/* - * Internal names for basic integral types. Omit the typedef if - * not possible for a machine/compiler combination. - */ -typedef __signed char __int8_t; -typedef unsigned char __uint8_t; -typedef short __int16_t; -typedef unsigned short __uint16_t; -typedef int __int32_t; -typedef unsigned int __uint32_t; -typedef long __int64_t; -typedef unsigned long __uint64_t; - -typedef long __intptr_t; -typedef unsigned long __uintptr_t; - -typedef __signed char __int_least8_t; -typedef unsigned char __uint_least8_t; -typedef short __int_least16_t; -typedef unsigned short __uint_least16_t; -typedef int __int_least32_t; -typedef unsigned int __uint_least32_t; -typedef long __int_least64_t; -typedef unsigned long __uint_least64_t; - -typedef int __int_fast8_t; -typedef unsigned int __uint_fast8_t; -typedef int __int_fast16_t; -typedef unsigned int __uint_fast16_t; -typedef int __int_fast32_t; -typedef unsigned int __uint_fast32_t; -typedef long __int_fast64_t; -typedef unsigned long __uint_fast64_t; - -typedef long __intmax_t; -typedef unsigned long __uintmax_t; - -/* - * mbstate_t is an opaque object to keep conversion state, during multibyte - * stream conversions. The content must not be referenced by user programs. - */ -typedef union { - char __mbstate8[128]; - __int64_t _mbstateL; /* for alignment */ -} __mbstate_t; - #endif /* !_MACHINE_ANSI_H_ */ diff --git a/sys/alpha/include/endian.h b/sys/alpha/include/endian.h index 9294f35..968d78c 100644 --- a/sys/alpha/include/endian.h +++ b/sys/alpha/include/endian.h @@ -39,7 +39,7 @@ #define _MACHINE_ENDIAN_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> /* * Define the order of 32-bit words in 64-bit words. diff --git a/sys/alpha/include/stdarg.h b/sys/alpha/include/stdarg.h index 1632add..5ecd44b 100644 --- a/sys/alpha/include/stdarg.h +++ b/sys/alpha/include/stdarg.h @@ -39,9 +39,9 @@ #ifndef _ALPHA_STDARG_H_ #define _ALPHA_STDARG_H_ -#include <machine/ansi.h> +#include <sys/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) diff --git a/sys/alpha/include/types.h b/sys/alpha/include/types.h deleted file mode 100644 index e0b82b4..0000000 --- a/sys/alpha/include/types.h +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * 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 - * 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. - * - * @(#)types.h 8.3 (Berkeley) 1/5/94 - * $NetBSD: types.h,v 1.8 1997/04/06 08:47:45 cgd Exp $ - * $FreeBSD$ - */ - -#ifndef _MACHTYPES_H_ -#define _MACHTYPES_H_ - -#include <sys/cdefs.h> - -typedef unsigned long vm_offset_t; -typedef long vm_ooffset_t; -typedef unsigned long vm_pindex_t; -typedef unsigned long vm_size_t; - -typedef __int64_t register_t; -typedef __uint64_t u_register_t; - -#ifdef _KERNEL -typedef long intfptr_t; -typedef unsigned long uintfptr_t; -#endif - -/* Critical section value */ -typedef register_t critical_t; - -/* Interrupt mask (spl, xxx_imask, etc) */ -typedef __uint32_t intrmask_t; - -#endif /* _MACHTYPES_H_ */ diff --git a/sys/alpha/include/varargs.h b/sys/alpha/include/varargs.h index bcf9ed3..a5a997d 100644 --- a/sys/alpha/include/varargs.h +++ b/sys/alpha/include/varargs.h @@ -46,9 +46,9 @@ #if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) -#include <machine/ansi.h> +#include <sys/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; typedef int __builtin_va_alist_t __attribute__((__mode__(__word__))); #define va_alist __builtin_va_alist diff --git a/sys/amd64/include/_types.h b/sys/amd64/include/_types.h new file mode 100644 index 0000000..4c62a9a --- /dev/null +++ b/sys/amd64/include/_types.h @@ -0,0 +1,139 @@ +/*- + * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> + * 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 + * 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: @(#)ansi.h 8.2 (Berkeley) 1/4/94 + * From: @(#)types.h 8.3 (Berkeley) 1/5/94 + * $FreeBSD$ + */ + +#ifndef _MACHINE__TYPES_H_ +#define _MACHINE__TYPES_H_ + +/* + * Basic types upon which most other types are built. + */ +typedef __signed char __int8_t; +typedef unsigned char __uint8_t; +typedef short __int16_t; +typedef unsigned short __uint16_t; +typedef int __int32_t; +typedef unsigned int __uint32_t; +typedef long __int64_t; +typedef unsigned long __uint64_t; + +/* + * Standard type definitions. + */ +typedef __int32_t __clock_t; /* clock()... */ +typedef __int32_t __clockid_t; /* clock_gettime()... */ +typedef __int64_t __critical_t; +typedef __uint32_t __fflags_t; /* file flags */ +typedef __int64_t __intfptr_t; +typedef __int64_t __intmax_t; +typedef __int64_t __intptr_t; +typedef __uint32_t __intrmask_t; +typedef __int32_t __int_fast8_t; +typedef __int32_t __int_fast16_t; +typedef __int32_t __int_fast32_t; +typedef __int64_t __int_fast64_t; +typedef __int8_t __int_least8_t; +typedef __int16_t __int_least16_t; +typedef __int32_t __int_least32_t; +typedef __int64_t __int_least64_t; +typedef __int64_t __off_t; /* file offset */ +typedef __int32_t __pid_t; /* process [group] */ +typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ +typedef __int64_t __register_t; +typedef __int64_t __segsz_t; /* segment size (in pages) */ +typedef __uint64_t __size_t; /* sizeof() */ +typedef __uint32_t __socklen_t; +typedef __int64_t __ssize_t; /* byte count or error */ +typedef __int32_t __time_t; /* time()... */ +typedef __int32_t __timer_t; /* timer_gettime()... */ +typedef __uint64_t __uintfptr_t; +typedef __uint64_t __uintmax_t; +typedef __uint64_t __uintptr_t; +typedef __uint32_t __uint_fast8_t; +typedef __uint32_t __uint_fast16_t; +typedef __uint32_t __uint_fast32_t; +typedef __uint64_t __uint_fast64_t; +typedef __uint8_t __uint_least8_t; +typedef __uint16_t __uint_least16_t; +typedef __uint32_t __uint_least32_t; +typedef __uint64_t __uint_least64_t; +typedef __uint64_t __u_register_t; +typedef __uint64_t __vm_offset_t; +typedef __int64_t __vm_ooffset_t; +typedef __uint64_t __vm_pindex_t; +typedef __uint64_t __vm_size_t; + +/* + * Unusual type definitions. + */ +/* + * The rune type above 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 __ct_rune_t instead of int. By changing it here, you + * lose a bit of ANSI conformance, but your programs will still work. + * + * NOTE: rune_t is not covered by ANSI nor other standards, and should not + * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and + * rune_t must be the same type. Also wint_t must be no narrower than + * wchar_t, and should also be able to hold all members of the largest + * character set plus one extra value (WEOF). wint_t must be at least 16 bits. + */ +typedef __int32_t __ct_rune_t; +typedef __int32_t __rune_t; +typedef __int32_t __wchar_t; +typedef __int32_t __wint_t; + +/* + * mbstate_t is an opaque object to keep conversion state, during multibyte + * stream conversions. The content must not be referenced by user programs. + */ +typedef union { + char __mbstate8[128]; + __int64_t _mbstateL; /* for alignment */ +} __mbstate_t; + +typedef __builtin_va_list __va_list; /* internally known to gcc */ +#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST) +#define __GNUC_VA_LIST +typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ +#endif + +#endif /* !_MACHINE__TYPES_H_ */ diff --git a/sys/amd64/include/endian.h b/sys/amd64/include/endian.h index a5ce643..c979683 100644 --- a/sys/amd64/include/endian.h +++ b/sys/amd64/include/endian.h @@ -38,7 +38,7 @@ #define _MACHINE_ENDIAN_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> /* * Define the order of 32-bit words in 64-bit words. diff --git a/sys/amd64/include/stdarg.h b/sys/amd64/include/stdarg.h index a2ec697..4048d13 100644 --- a/sys/amd64/include/stdarg.h +++ b/sys/amd64/include/stdarg.h @@ -31,9 +31,9 @@ #ifndef _MACHINE_STDARG_H_ #define _MACHINE_STDARG_H_ -#include <machine/ansi.h> +#include <sys/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #define va_start(ap, last) \ __builtin_stdarg_start((ap), (last)) diff --git a/sys/amd64/include/varargs.h b/sys/amd64/include/varargs.h index bcaf875..5d8511e 100644 --- a/sys/amd64/include/varargs.h +++ b/sys/amd64/include/varargs.h @@ -45,9 +45,9 @@ #if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) -#include <machine/ansi.h> +#include <sys/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; typedef int __builtin_va_alist_t __attribute__((__mode__(__word__))); #define va_alist __builtin_va_alist diff --git a/sys/arm/include/_types.h b/sys/arm/include/_types.h new file mode 100644 index 0000000..34cf3e8 --- /dev/null +++ b/sys/arm/include/_types.h @@ -0,0 +1,151 @@ +/*- + * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> + * 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 + * 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: @(#)ansi.h 8.2 (Berkeley) 1/4/94 + * From: @(#)types.h 8.3 (Berkeley) 1/5/94 + * $FreeBSD$ + */ + +#ifndef _MACHINE__TYPES_H_ +#define _MACHINE__TYPES_H_ + +/* + * Basic types upon which most other types are built. + */ +typedef __signed char __int8_t; +typedef unsigned char __uint8_t; +typedef short __int16_t; +typedef unsigned short __uint16_t; +typedef int __int32_t; +typedef unsigned int __uint32_t; + +#if defined(__GNUC__) +typedef int __attribute__((__mode__(__DI__))) __int64_t; +typedef unsigned int __attribute__((__mode__(__DI__))) __uint64_t; +#else +/* LONGLONG */ +typedef long long __int64_t; +/* LONGLONG */ +typedef unsigned long long __uint64_t; +#endif + +/* + * Standard type definitions. + */ +typedef __uint32_t __clock_t; /* clock()... */ +typedef __int32_t __clockid_t; /* clock_gettime()... */ +typedef __int32_t __critical_t; +typedef __uint32_t __fflags_t; /* file flags */ +typedef __int32_t __intfptr_t; +typedef __int64_t __intmax_t; +typedef __int32_t __intptr_t; +typedef __uint32_t __intrmask_t; +typedef __int32_t __int_fast8_t; +typedef __int32_t __int_fast16_t; +typedef __int32_t __int_fast32_t; +typedef __int64_t __int_fast64_t; +typedef __int8_t __int_least8_t; +typedef __int16_t __int_least16_t; +typedef __int32_t __int_least32_t; +typedef __int64_t __int_least64_t; +typedef __int64_t __off_t; /* file offset */ +typedef __int32_t __pid_t; /* process [group] */ +typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */ +typedef __int32_t __register_t; +typedef __int32_t __segsz_t; /* segment size (in pages) */ +typedef __uint32_t __size_t; /* sizeof() */ +typedef __uint32_t __socklen_t; +typedef __int32_t __ssize_t; /* byte count or error */ +typedef __int32_t __time_t; /* time()... */ +typedef __int32_t __timer_t; /* timer_gettime()... */ +typedef __uint32_t __uintfptr_t; +typedef __uint64_t __uintmax_t; +typedef __uint32_t __uintptr_t; +typedef __uint32_t __uint_fast8_t; +typedef __uint32_t __uint_fast16_t; +typedef __uint32_t __uint_fast32_t; +typedef __uint64_t __uint_fast64_t; +typedef __uint8_t __uint_least8_t; +typedef __uint16_t __uint_least16_t; +typedef __uint32_t __uint_least32_t; +typedef __uint64_t __uint_least64_t; +typedef __uint32_t __u_register_t; +typedef __uint32_t __vm_offset_t; +typedef __int64_t __vm_ooffset_t; +typedef __uint64_t __vm_pindex_t; +typedef __uint32_t __vm_size_t; + +/* + * Unusual type definitions. + */ +/* + * The rune type above 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 __ct_rune_t instead of int. By changing it here, you + * lose a bit of ANSI conformance, but your programs will still work. + * + * NOTE: rune_t is not covered by ANSI nor other standards, and should not + * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and + * rune_t must be the same type. Also wint_t must be no narrower than + * wchar_t, and should also be able to hold all members of the largest + * character set plus one extra value (WEOF). wint_t must be at least 16 bits. + */ +typedef __int32_t __ct_rune_t; +typedef __int32_t __rune_t; +typedef __int32_t __wchar_t; +typedef __int32_t __wint_t; + +/* + * mbstate_t is an opaque object to keep conversion state, during multibyte + * stream conversions. The content must not be referenced by user programs. + */ +typedef union { + char __mbstate8[128]; + __int64_t _mbstateL; /* for alignment */ +} __mbstate_t; + +#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) +typedef __builtin_va_list __va_list; /* internally known to gcc */ +#else +typedef char * __va_list; +#endif /* post GCC 2.95 */ +#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST) +#define __GNUC_VA_LIST +typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ +#endif + +#endif /* !_MACHINE__TYPES_H_ */ diff --git a/sys/arm/include/ansi.h b/sys/arm/include/ansi.h index 2596276..5525ef7 100644 --- a/sys/arm/include/ansi.h +++ b/sys/arm/include/ansi.h @@ -38,66 +38,6 @@ #define _MACHINE_ANSI_H_ /* - * Types which are fundamental to the implementation and may appear in - * more than one standard header are defined here. Standard headers - * then use: - * #ifdef _BSD_SIZE_T_ - * typedef _BSD_SIZE_T_ size_t; - * #undef _BSD_SIZE_T_ - * #endif - */ -#define _BSD_CLOCK_T_ unsigned long /* clock()... */ -#define _BSD_CLOCKID_T_ int /* clock_gettime()... */ -#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */ -#define _BSD_PTRDIFF_T_ int /* ptr1 - ptr2 */ -#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */ -#define _BSD_SIZE_T_ unsigned int /* sizeof() */ -#define _BSD_SOCKLEN_T_ __uint32_t /* socklen_t (duh) */ -#define _BSD_SSIZE_T_ int /* byte count or error */ -#define _BSD_TIME_T_ int /* time()... */ -#define _BSD_TIMER_T_ int /* timer_gettime()... */ -#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */ -#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t (see below) */ - -/* - * Types which are fundamental to the implementation and must be used - * in more than one standard header although they are only declared in - * one (perhaps nonstandard) header are defined here. Standard headers - * use _BSD_XXX_T_ without undef'ing it. - */ -#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */ -#define _BSD_OFF_T_ __int64_t /* file offset */ -#define _BSD_PID_T_ int /* process [group] */ - -#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) -#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */ -#else -#define _BSD_VA_LIST_ char * /* va_list */ -#endif /* post GCC 2.95 */ -#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - -/* - * The rune type above 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 _BSD_CT_RUNE_T_ instead of int. By changing it - * here, you lose a bit of ANSI conformance, but your programs will still - * work. - * - * NOTE: rune_t is not covered by ANSI nor other standards, and should not - * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and - * rune_t must be the same type. Also wint_t must be no narrower than - * wchar_t, and should also be able to hold all members of the largest - * character set plus one extra value (WEOF). wint_t must be at least 16 bits. - */ - -/* * Frequencies of the clock ticks reported by clock() and times(). They * are the same as stathz for bogus historical reasons. They should be * 1e6 because clock() and times() are implemented using getrusage() and @@ -110,65 +50,4 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ #define _BSD_CLK_TCK_ 100 #define _BSD_CLOCKS_PER_SEC_ 100 -/* - * XXX this paragraph is very out of date. - * Typedefs for especially magic types. #define's wouldn't work in the - * __GNUC__ case, since __attribute__(()) only works in certain contexts. - * This is not in <machine/types.h>, since that has too much namespace - * pollution for inclusion in ANSI headers, yet we need __int64_t in at - * least <stdio.h>. - */ -#ifdef __GNUC__ -typedef int __attribute__((__mode__(__DI__))) __int64_t; -typedef unsigned int __attribute__((__mode__(__DI__))) __uint64_t; -#else -/* LONGLONG */ -typedef long long __int64_t; -/* LONGLONG */ -typedef unsigned long long __uint64_t; -#endif -/* - * Internal names for basic integral types. Omit the typedef if - * not possible for a machine/compiler combination. - */ -typedef __signed char __int8_t; -typedef unsigned char __uint8_t; -typedef short __int16_t; -typedef unsigned short __uint16_t; -typedef int __int32_t; -typedef unsigned int __uint32_t; - -typedef int __intptr_t; -typedef unsigned int __uintptr_t; - -typedef __signed char __int_least8_t; -typedef unsigned char __uint_least8_t; -typedef short __int_least16_t; -typedef unsigned short __uint_least16_t; -typedef int __int_least32_t; -typedef unsigned int __uint_least32_t; -typedef __int64_t __int_least64_t; -typedef __uint64_t __uint_least64_t; - -typedef int __int_fast8_t; -typedef unsigned int __uint_fast8_t; -typedef int __int_fast16_t; -typedef unsigned int __uint_fast16_t; -typedef int __int_fast32_t; -typedef unsigned int __uint_fast32_t; -typedef __int64_t __int_fast64_t; -typedef __uint64_t __uint_fast64_t; - -typedef __int64_t __intmax_t; -typedef __uint64_t __uintmax_t; - -/* - * mbstate_t is an opaque object to keep conversion state, during multibyte - * stream conversions. The content must not be referenced by user programs. - */ -typedef union { - char __mbstate8[128]; - __int64_t _mbstateL; /* for alignment */ -} __mbstate_t; - -#endif /* _MACHINE_ANSI_H_ */ +#endif /* !_MACHINE_ANSI_H_ */ diff --git a/sys/arm/include/types.h b/sys/arm/include/types.h deleted file mode 100644 index 0769856..0000000 --- a/sys/arm/include/types.h +++ /dev/null @@ -1,59 +0,0 @@ -/*- - * 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 - * 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. - * - * @(#)types.h 8.3 (Berkeley) 1/5/94 - * $FreeBSD$ - */ - -#ifndef _MACHINE_TYPES_H_ -#define _MACHINE_TYPES_H_ - -typedef unsigned int vm_offset_t; -typedef __int64_t vm_ooffset_t; -typedef __uint64_t vm_pindex_t; -typedef unsigned int vm_size_t; - -typedef __int32_t register_t; -typedef __uint32_t u_register_t; - -#ifdef _KERNEL -typedef int intfptr_t; -typedef unsigned int uintfptr_t; -#endif - -/* Critical section value */ -typedef register_t critical_t; - -/* Interrupt mask (spl, xxx_imask, etc) */ -typedef __uint32_t intrmask_t; - -#endif /* !_MACHINE_TYPES_H_ */ diff --git a/sys/i386/include/_types.h b/sys/i386/include/_types.h new file mode 100644 index 0000000..34cf3e8 --- /dev/null +++ b/sys/i386/include/_types.h @@ -0,0 +1,151 @@ +/*- + * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> + * 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 + * 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: @(#)ansi.h 8.2 (Berkeley) 1/4/94 + * From: @(#)types.h 8.3 (Berkeley) 1/5/94 + * $FreeBSD$ + */ + +#ifndef _MACHINE__TYPES_H_ +#define _MACHINE__TYPES_H_ + +/* + * Basic types upon which most other types are built. + */ +typedef __signed char __int8_t; +typedef unsigned char __uint8_t; +typedef short __int16_t; +typedef unsigned short __uint16_t; +typedef int __int32_t; +typedef unsigned int __uint32_t; + +#if defined(__GNUC__) +typedef int __attribute__((__mode__(__DI__))) __int64_t; +typedef unsigned int __attribute__((__mode__(__DI__))) __uint64_t; +#else +/* LONGLONG */ +typedef long long __int64_t; +/* LONGLONG */ +typedef unsigned long long __uint64_t; +#endif + +/* + * Standard type definitions. + */ +typedef __uint32_t __clock_t; /* clock()... */ +typedef __int32_t __clockid_t; /* clock_gettime()... */ +typedef __int32_t __critical_t; +typedef __uint32_t __fflags_t; /* file flags */ +typedef __int32_t __intfptr_t; +typedef __int64_t __intmax_t; +typedef __int32_t __intptr_t; +typedef __uint32_t __intrmask_t; +typedef __int32_t __int_fast8_t; +typedef __int32_t __int_fast16_t; +typedef __int32_t __int_fast32_t; +typedef __int64_t __int_fast64_t; +typedef __int8_t __int_least8_t; +typedef __int16_t __int_least16_t; +typedef __int32_t __int_least32_t; +typedef __int64_t __int_least64_t; +typedef __int64_t __off_t; /* file offset */ +typedef __int32_t __pid_t; /* process [group] */ +typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */ +typedef __int32_t __register_t; +typedef __int32_t __segsz_t; /* segment size (in pages) */ +typedef __uint32_t __size_t; /* sizeof() */ +typedef __uint32_t __socklen_t; +typedef __int32_t __ssize_t; /* byte count or error */ +typedef __int32_t __time_t; /* time()... */ +typedef __int32_t __timer_t; /* timer_gettime()... */ +typedef __uint32_t __uintfptr_t; +typedef __uint64_t __uintmax_t; +typedef __uint32_t __uintptr_t; +typedef __uint32_t __uint_fast8_t; +typedef __uint32_t __uint_fast16_t; +typedef __uint32_t __uint_fast32_t; +typedef __uint64_t __uint_fast64_t; +typedef __uint8_t __uint_least8_t; +typedef __uint16_t __uint_least16_t; +typedef __uint32_t __uint_least32_t; +typedef __uint64_t __uint_least64_t; +typedef __uint32_t __u_register_t; +typedef __uint32_t __vm_offset_t; +typedef __int64_t __vm_ooffset_t; +typedef __uint64_t __vm_pindex_t; +typedef __uint32_t __vm_size_t; + +/* + * Unusual type definitions. + */ +/* + * The rune type above 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 __ct_rune_t instead of int. By changing it here, you + * lose a bit of ANSI conformance, but your programs will still work. + * + * NOTE: rune_t is not covered by ANSI nor other standards, and should not + * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and + * rune_t must be the same type. Also wint_t must be no narrower than + * wchar_t, and should also be able to hold all members of the largest + * character set plus one extra value (WEOF). wint_t must be at least 16 bits. + */ +typedef __int32_t __ct_rune_t; +typedef __int32_t __rune_t; +typedef __int32_t __wchar_t; +typedef __int32_t __wint_t; + +/* + * mbstate_t is an opaque object to keep conversion state, during multibyte + * stream conversions. The content must not be referenced by user programs. + */ +typedef union { + char __mbstate8[128]; + __int64_t _mbstateL; /* for alignment */ +} __mbstate_t; + +#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) +typedef __builtin_va_list __va_list; /* internally known to gcc */ +#else +typedef char * __va_list; +#endif /* post GCC 2.95 */ +#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST) +#define __GNUC_VA_LIST +typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ +#endif + +#endif /* !_MACHINE__TYPES_H_ */ diff --git a/sys/i386/include/ansi.h b/sys/i386/include/ansi.h index 45f86fe..06916b2 100644 --- a/sys/i386/include/ansi.h +++ b/sys/i386/include/ansi.h @@ -38,68 +38,6 @@ #define _MACHINE_ANSI_H_ /* - * Types which are fundamental to the implementation and may appear in - * more than one standard header are defined here. Standard headers - * then use: - * #ifdef _BSD_SIZE_T_ - * typedef _BSD_SIZE_T_ size_t; - * #undef _BSD_SIZE_T_ - * #endif - */ -#define _BSD_CLOCK_T_ unsigned long /* clock()... */ -#define _BSD_CLOCKID_T_ int /* clock_gettime()... */ -#define _BSD_FFLAGS_T_ __uint_least32_t /* file flags */ -#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */ -#define _BSD_PTRDIFF_T_ int /* ptr1 - ptr2 */ -#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */ -#define _BSD_SEGSZ_T_ __int32_t /* segment size (in pages) */ -#define _BSD_SIZE_T_ unsigned int /* sizeof() */ -#define _BSD_SOCKLEN_T_ __uint32_t /* socklen_t (duh) */ -#define _BSD_SSIZE_T_ int /* byte count or error */ -#define _BSD_TIME_T_ int /* time()... */ -#define _BSD_TIMER_T_ int /* timer_gettime()... */ -#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */ -#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t (see below) */ - -/* - * Types which are fundamental to the implementation and must be used - * in more than one standard header although they are only declared in - * one (perhaps nonstandard) header are defined here. Standard headers - * use _BSD_XXX_T_ without undef'ing it. - */ -#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */ -#define _BSD_OFF_T_ __int64_t /* file offset */ -#define _BSD_PID_T_ int /* process [group] */ - -#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) -#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */ -#else -#define _BSD_VA_LIST_ char * /* va_list */ -#endif /* post GCC 2.95 */ -#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - -/* - * The rune type above 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 _BSD_CT_RUNE_T_ instead of int. By changing it - * here, you lose a bit of ANSI conformance, but your programs will still - * work. - * - * NOTE: rune_t is not covered by ANSI nor other standards, and should not - * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and - * rune_t must be the same type. Also wint_t must be no narrower than - * wchar_t, and should also be able to hold all members of the largest - * character set plus one extra value (WEOF). wint_t must be at least 16 bits. - */ - -/* * Frequencies of the clock ticks reported by clock() and times(). They * are the same as stathz for bogus historical reasons. They should be * 1e6 because clock() and times() are implemented using getrusage() and @@ -112,65 +50,4 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ #define _BSD_CLK_TCK_ 128 #define _BSD_CLOCKS_PER_SEC_ 128 -/* - * XXX this paragraph is very out of date. - * Typedefs for especially magic types. #define's wouldn't work in the - * __GNUC__ case, since __attribute__(()) only works in certain contexts. - * This is not in <machine/types.h>, since that has too much namespace - * pollution for inclusion in ANSI headers, yet we need __int64_t in at - * least <stdio.h>. - */ -#ifdef __GNUC__ -typedef int __attribute__((__mode__(__DI__))) __int64_t; -typedef unsigned int __attribute__((__mode__(__DI__))) __uint64_t; -#else -/* LONGLONG */ -typedef long long __int64_t; -/* LONGLONG */ -typedef unsigned long long __uint64_t; -#endif -/* - * Internal names for basic integral types. Omit the typedef if - * not possible for a machine/compiler combination. - */ -typedef __signed char __int8_t; -typedef unsigned char __uint8_t; -typedef short __int16_t; -typedef unsigned short __uint16_t; -typedef int __int32_t; -typedef unsigned int __uint32_t; - -typedef int __intptr_t; -typedef unsigned int __uintptr_t; - -typedef __signed char __int_least8_t; -typedef unsigned char __uint_least8_t; -typedef short __int_least16_t; -typedef unsigned short __uint_least16_t; -typedef int __int_least32_t; -typedef unsigned int __uint_least32_t; -typedef __int64_t __int_least64_t; -typedef __uint64_t __uint_least64_t; - -typedef int __int_fast8_t; -typedef unsigned int __uint_fast8_t; -typedef int __int_fast16_t; -typedef unsigned int __uint_fast16_t; -typedef int __int_fast32_t; -typedef unsigned int __uint_fast32_t; -typedef __int64_t __int_fast64_t; -typedef __uint64_t __uint_fast64_t; - -typedef __int64_t __intmax_t; -typedef __uint64_t __uintmax_t; - -/* - * mbstate_t is an opaque object to keep conversion state, during multibyte - * stream conversions. The content must not be referenced by user programs. - */ -typedef union { - char __mbstate8[128]; - __int64_t _mbstateL; /* for alignment */ -} __mbstate_t; - #endif /* !_MACHINE_ANSI_H_ */ diff --git a/sys/i386/include/endian.h b/sys/i386/include/endian.h index 84e7fe6..c8b86ee 100644 --- a/sys/i386/include/endian.h +++ b/sys/i386/include/endian.h @@ -38,7 +38,7 @@ #define _MACHINE_ENDIAN_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> /* * Define the order of 32-bit words in 64-bit words. diff --git a/sys/i386/include/stdarg.h b/sys/i386/include/stdarg.h index 51416f7..1432c6c 100644 --- a/sys/i386/include/stdarg.h +++ b/sys/i386/include/stdarg.h @@ -38,9 +38,9 @@ #ifndef _STDARG_H_ #define _STDARG_H_ -#include <machine/ansi.h> +#include <sys/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) diff --git a/sys/i386/include/types.h b/sys/i386/include/types.h deleted file mode 100644 index 0769856..0000000 --- a/sys/i386/include/types.h +++ /dev/null @@ -1,59 +0,0 @@ -/*- - * 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 - * 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. - * - * @(#)types.h 8.3 (Berkeley) 1/5/94 - * $FreeBSD$ - */ - -#ifndef _MACHINE_TYPES_H_ -#define _MACHINE_TYPES_H_ - -typedef unsigned int vm_offset_t; -typedef __int64_t vm_ooffset_t; -typedef __uint64_t vm_pindex_t; -typedef unsigned int vm_size_t; - -typedef __int32_t register_t; -typedef __uint32_t u_register_t; - -#ifdef _KERNEL -typedef int intfptr_t; -typedef unsigned int uintfptr_t; -#endif - -/* Critical section value */ -typedef register_t critical_t; - -/* Interrupt mask (spl, xxx_imask, etc) */ -typedef __uint32_t intrmask_t; - -#endif /* !_MACHINE_TYPES_H_ */ diff --git a/sys/i386/include/varargs.h b/sys/i386/include/varargs.h index bcaf875..5d8511e 100644 --- a/sys/i386/include/varargs.h +++ b/sys/i386/include/varargs.h @@ -45,9 +45,9 @@ #if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) -#include <machine/ansi.h> +#include <sys/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; typedef int __builtin_va_alist_t __attribute__((__mode__(__word__))); #define va_alist __builtin_va_alist diff --git a/sys/ia64/include/_types.h b/sys/ia64/include/_types.h new file mode 100644 index 0000000..3ca3584 --- /dev/null +++ b/sys/ia64/include/_types.h @@ -0,0 +1,143 @@ +/*- + * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> + * 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 + * 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: @(#)ansi.h 8.2 (Berkeley) 1/4/94 + * From: @(#)types.h 8.3 (Berkeley) 1/5/94 + * $FreeBSD$ + */ + +#ifndef _MACHINE__TYPES_H_ +#define _MACHINE__TYPES_H_ + +/* + * Basic types upon which most other types are built. + */ +typedef __signed char __int8_t; +typedef unsigned char __uint8_t; +typedef short __int16_t; +typedef unsigned short __uint16_t; +typedef int __int32_t; +typedef unsigned int __uint32_t; +typedef long __int64_t; +typedef unsigned long __uint64_t; + +/* + * Standard type definitions. + */ +typedef __int32_t __clock_t; /* clock()... */ +typedef __int32_t __clockid_t; /* clock_gettime()... */ +typedef __int64_t __critical_t; +typedef __uint32_t __fflags_t; /* file flags */ +typedef __int64_t __intfptr_t; +typedef __int64_t __intmax_t; +typedef __int64_t __intptr_t; +typedef __uint32_t __intrmask_t; +typedef __int32_t __int_fast8_t; +typedef __int32_t __int_fast16_t; +typedef __int32_t __int_fast32_t; +typedef __int64_t __int_fast64_t; +typedef __int8_t __int_least8_t; +typedef __int16_t __int_least16_t; +typedef __int32_t __int_least32_t; +typedef __int64_t __int_least64_t; +typedef __int64_t __off_t; /* file offset */ +typedef __int32_t __pid_t; /* process [group] */ +typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ +typedef __int64_t __register_t; +typedef __int64_t __segsz_t; /* segment size (in pages) */ +typedef __uint64_t __size_t; /* sizeof() */ +typedef __uint32_t __socklen_t; +typedef __int64_t __ssize_t; /* byte count or error */ +typedef __int32_t __time_t; /* time()... */ +typedef __int32_t __timer_t; /* timer_gettime()... */ +typedef __uint64_t __uintfptr_t; +typedef __uint64_t __uintmax_t; +typedef __uint64_t __uintptr_t; +typedef __uint32_t __uint_fast8_t; +typedef __uint32_t __uint_fast16_t; +typedef __uint32_t __uint_fast32_t; +typedef __uint64_t __uint_fast64_t; +typedef __uint8_t __uint_least8_t; +typedef __uint16_t __uint_least16_t; +typedef __uint32_t __uint_least32_t; +typedef __uint64_t __uint_least64_t; +typedef __uint64_t __u_register_t; +typedef __uint64_t __vm_offset_t; +typedef __int64_t __vm_ooffset_t; +typedef __uint64_t __vm_pindex_t; +typedef __uint64_t __vm_size_t; + +/* + * Unusual type definitions. + */ +/* + * The rune type above 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 __ct_rune_t instead of int. By changing it here, you + * lose a bit of ANSI conformance, but your programs will still work. + * + * NOTE: rune_t is not covered by ANSI nor other standards, and should not + * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and + * rune_t must be the same type. Also wint_t must be no narrower than + * wchar_t, and should also be able to hold all members of the largest + * character set plus one extra value (WEOF). wint_t must be at least 16 bits. + */ +typedef __int32_t __ct_rune_t; +typedef __int32_t __rune_t; +typedef __int32_t __wchar_t; +typedef __int32_t __wint_t; + +/* + * mbstate_t is an opaque object to keep conversion state, during multibyte + * stream conversions. The content must not be referenced by user programs. + */ +typedef union { + char __mbstate8[128]; + __int64_t _mbstateL; /* for alignment */ +} __mbstate_t; + +#ifdef __GNUC__ +typedef __builtin_va_list __va_list; /* internally known to gcc */ +#if !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST) +#define __GNUC_VA_LIST +typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ +#endif +#else +#error Must add va_list support for this non-GCC compiler. +#endif /* __GNUC__ */ + +#endif /* !_MACHINE__TYPES_H_ */ diff --git a/sys/ia64/include/ansi.h b/sys/ia64/include/ansi.h index a7cde5b..11dbf03 100644 --- a/sys/ia64/include/ansi.h +++ b/sys/ia64/include/ansi.h @@ -39,68 +39,6 @@ #define _MACHINE_ANSI_H_ /* - * Types which are fundamental to the implementation and may appear in - * more than one standard header are defined here. Standard headers - * then use: - * #ifdef _BSD_SIZE_T_ - * typedef _BSD_SIZE_T_ size_t; - * #undef _BSD_SIZE_T_ - * #endif - */ -#define _BSD_CLOCK_T_ int /* clock() */ -#define _BSD_CLOCKID_T_ int /* clockid_t */ -#define _BSD_FFLAGS_T_ __uint_least32_t /* file flags */ -#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */ -#define _BSD_PTRDIFF_T_ long /* ptr1 - ptr2 */ -#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */ -#define _BSD_SEGSZ_T_ __int64_t /* segment size (in pages) */ -#define _BSD_SIZE_T_ unsigned long /* sizeof() */ -#define _BSD_SOCKLEN_T_ __uint32_t -#define _BSD_SSIZE_T_ long /* byte count or error */ -#define _BSD_TIME_T_ int /* time() */ -#define _BSD_TIMER_T_ int /* timer_t */ -#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */ -#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t (see below) */ - -/* - * Types which are fundamental to the implementation and must be used - * in more than one standard header although they are only declared in - * one (perhaps nonstandard) header are defined here. Standard headers - * use _BSD_XXX_T_ without undef'ing it. - */ -#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */ -#define _BSD_OFF_T_ long /* file offset */ -#define _BSD_PID_T_ int /* process [group] */ - -#ifdef __GNUC__ -#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */ -#if !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif -#else -#error Must add va_list support for this non-GCC compiler. -#endif /*__GNUC__*/ - -/* - * The rune type above 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 _BSD_CT_RUNE_T_ instead of int. By changing it - * here, you lose a bit of ANSI conformance, but your programs will still - * work. - * - * NOTE: rune_t is not covered by ANSI nor other standards, and should not - * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and - * rune_t must be the same type. Also wint_t must be no narrower than - * wchar_t, and should also be able to hold all members of the largest - * character set plus one extra value (WEOF). wint_t must be at least 16 bits. - */ - -/* * Frequencies of the clock ticks reported by clock() and times(). They * are the same as stathz for bogus historical reasons. They should be * 1e6 because clock() and times() are implemented using getrusage() and @@ -113,50 +51,4 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ #define _BSD_CLK_TCK_ 100 #define _BSD_CLOCKS_PER_SEC_ 100 -/* - * Internal names for basic integral types. Omit the typedef if - * not possible for a machine/compiler combination. - */ -typedef __signed char __int8_t; -typedef unsigned char __uint8_t; -typedef short __int16_t; -typedef unsigned short __uint16_t; -typedef int __int32_t; -typedef unsigned int __uint32_t; -typedef long __int64_t; -typedef unsigned long __uint64_t; - -typedef long __intptr_t; -typedef unsigned long __uintptr_t; - -typedef __signed char __int_least8_t; -typedef unsigned char __uint_least8_t; -typedef short __int_least16_t; -typedef unsigned short __uint_least16_t; -typedef int __int_least32_t; -typedef unsigned int __uint_least32_t; -typedef long __int_least64_t; -typedef unsigned long __uint_least64_t; - -typedef int __int_fast8_t; -typedef unsigned int __uint_fast8_t; -typedef int __int_fast16_t; -typedef unsigned int __uint_fast16_t; -typedef int __int_fast32_t; -typedef unsigned int __uint_fast32_t; -typedef long __int_fast64_t; -typedef unsigned long __uint_fast64_t; - -typedef long __intmax_t; -typedef unsigned long __uintmax_t; - -/* - * mbstate_t is an opaque object to keep conversion state, during multibyte - * stream conversions. The content must not be referenced by user programs. - */ -typedef union { - char __mbstate8[128]; - __int64_t _mbstateL; /* for alignment */ -} __mbstate_t; - -#endif /* _MACHINE_ANSI_H_ */ +#endif /* !_MACHINE_ANSI_H_ */ diff --git a/sys/ia64/include/endian.h b/sys/ia64/include/endian.h index 5ae1ac5..7ba8bbf 100644 --- a/sys/ia64/include/endian.h +++ b/sys/ia64/include/endian.h @@ -39,7 +39,7 @@ #define _MACHINE_ENDIAN_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> /* * Define the order of 32-bit words in 64-bit words. diff --git a/sys/ia64/include/stdarg.h b/sys/ia64/include/stdarg.h index 4a0bcf8..f48a20b 100644 --- a/sys/ia64/include/stdarg.h +++ b/sys/ia64/include/stdarg.h @@ -38,9 +38,9 @@ #ifndef _MACHINE_STDARG_H_ #define _MACHINE_STDARG_H_ -#include <machine/ansi.h> +#include <sys/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) diff --git a/sys/ia64/include/types.h b/sys/ia64/include/types.h deleted file mode 100644 index e898159..0000000 --- a/sys/ia64/include/types.h +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * 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 - * 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. - * - * @(#)types.h 8.3 (Berkeley) 1/5/94 - * $NetBSD: types.h,v 1.8 1997/04/06 08:47:45 cgd Exp $ - * $FreeBSD$ - */ - -#ifndef _MACHTYPES_H_ -#define _MACHTYPES_H_ - -#include <sys/cdefs.h> - -typedef unsigned long vm_offset_t; -typedef long vm_ooffset_t; -typedef unsigned long vm_pindex_t; -typedef unsigned long vm_size_t; - -typedef __int64_t register_t; -typedef __uint64_t u_register_t; - -#ifdef _KERNEL -typedef long intfptr_t; -typedef unsigned long uintfptr_t; -#endif - -/* Critical section value */ -typedef register_t critical_t; - -/* Interrupt mask (spl, xxx_imask, etc) */ -typedef __uint64_t intrmask_t; - -#endif /* _MACHTYPES_H_ */ diff --git a/sys/ia64/include/varargs.h b/sys/ia64/include/varargs.h index f378b00..fcc78c2 100644 --- a/sys/ia64/include/varargs.h +++ b/sys/ia64/include/varargs.h @@ -43,9 +43,9 @@ #ifndef _MACHINE_VARARGS_H_ #define _MACHINE_VARARGS_H_ -#include <machine/ansi.h> +#include <sys/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; typedef int __builtin_va_alist_t __attribute__((__mode__(__word__))); #define va_alist __builtin_va_alist diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 282415d..e543a75 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -75,9 +75,9 @@ typedef uint16_t in_port_t; #define _IN_PORT_T_DECLARED #endif -#ifdef _BSD_SA_FAMILY_T_ -typedef _BSD_SA_FAMILY_T_ sa_family_t; -#undef _BSD_SA_FAMILY_T_ +#ifndef _SA_FAMILY_T_DECLARED +typedef __sa_family_t sa_family_t; +#define _SA_FAMILY_T_DECLARED #endif /* Internet address (a structure for historical reasons). */ diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h index 731c665..1a504c8 100644 --- a/sys/netinet6/in6.h +++ b/sys/netinet6/in6.h @@ -616,9 +616,9 @@ void in6_sin_2_v4mapsin6_in_sock __P((struct sockaddr **nam)); extern int (*faithprefix_p)(struct in6_addr *); #endif /* _KERNEL */ -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif __BEGIN_DECLS diff --git a/sys/powerpc/include/_types.h b/sys/powerpc/include/_types.h new file mode 100644 index 0000000..dac8f97 --- /dev/null +++ b/sys/powerpc/include/_types.h @@ -0,0 +1,151 @@ +/*- + * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> + * 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 + * 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: @(#)ansi.h 8.2 (Berkeley) 1/4/94 + * From: @(#)types.h 8.3 (Berkeley) 1/5/94 + * $FreeBSD$ + */ + +#ifndef _MACHINE__TYPES_H_ +#define _MACHINE__TYPES_H_ + +/* + * Basic types upon which most other types are built. + */ +typedef __signed char __int8_t; +typedef unsigned char __uint8_t; +typedef short __int16_t; +typedef unsigned short __uint16_t; +typedef int __int32_t; +typedef unsigned int __uint32_t; +/* LONGLONG */ +typedef long long __int64_t; +/* LONGLONG */ +typedef unsigned long long __uint64_t; + +/* + * Standard type definitions. + */ +typedef __uint32_t __clock_t; /* clock()... */ +typedef __int32_t __clockid_t; /* clock_gettime()... */ +typedef __int32_t __critical_t; +typedef __uint32_t __fflags_t; /* file flags */ +typedef __int32_t __intfptr_t; +typedef __int64_t __intmax_t; +typedef __int32_t __intptr_t; +typedef __uint32_t __intrmask_t; +typedef __int32_t __int_fast8_t; +typedef __int32_t __int_fast16_t; +typedef __int32_t __int_fast32_t; +typedef __int64_t __int_fast64_t; +typedef __int8_t __int_least8_t; +typedef __int16_t __int_least16_t; +typedef __int32_t __int_least32_t; +typedef __int64_t __int_least64_t; +typedef __int64_t __off_t; /* file offset */ +typedef __int32_t __pid_t; /* process [group] */ +typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */ +typedef __int32_t __register_t; +typedef __int32_t __segsz_t; /* segment size (in pages) */ +typedef __uint32_t __size_t; /* sizeof() */ +typedef __uint32_t __socklen_t; +typedef __int32_t __ssize_t; /* byte count or error */ +typedef __int32_t __time_t; /* time()... */ +typedef __int32_t __timer_t; /* timer_gettime()... */ +typedef __uint32_t __uintfptr_t; +typedef __uint64_t __uintmax_t; +typedef __uint32_t __uintptr_t; +typedef __uint32_t __uint_fast8_t; +typedef __uint32_t __uint_fast16_t; +typedef __uint32_t __uint_fast32_t; +typedef __uint64_t __uint_fast64_t; +typedef __uint8_t __uint_least8_t; +typedef __uint16_t __uint_least16_t; +typedef __uint32_t __uint_least32_t; +typedef __uint64_t __uint_least64_t; +typedef __uint32_t __u_register_t; +typedef __uint32_t __vm_offset_t; +typedef __int64_t __vm_ooffset_t; +typedef __uint64_t __vm_pindex_t; +typedef __uint32_t __vm_size_t; + +/* + * Unusual type definitions. + */ +/* + * The rune type above 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 __ct_rune_t instead of int. By changing it here, you + * lose a bit of ANSI conformance, but your programs will still work. + * + * NOTE: rune_t is not covered by ANSI nor other standards, and should not + * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and + * rune_t must be the same type. Also wint_t must be no narrower than + * wchar_t, and should also be able to hold all members of the largest + * character set plus one extra value (WEOF). wint_t must be at least 16 bits. + */ +typedef __int32_t __ct_rune_t; +typedef __int32_t __rune_t; +typedef __int32_t __wchar_t; +typedef __int32_t __wint_t; + +/* + * mbstate_t is an opaque object to keep conversion state, during multibyte + * stream conversions. The content must not be referenced by user programs. + */ +typedef union { + char __mbstate8[128]; + __int64_t _mbstateL; /* for alignment */ +} __mbstate_t; + +#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) +typedef __builtin_va_list __va_list; /* internally known to gcc */ +#else +typedef struct { + char __gpr; + char __fpr; + char __pad[2]; + char *__stack; + char *__base; +} __va_list; +#endif /* post GCC 2.95 */ +#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST) +#define __GNUC_VA_LIST +typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ +#endif + +#endif /* !_MACHINE__TYPES_H_ */ diff --git a/sys/powerpc/include/ansi.h b/sys/powerpc/include/ansi.h index 19fcc5a..5525ef7 100644 --- a/sys/powerpc/include/ansi.h +++ b/sys/powerpc/include/ansi.h @@ -38,75 +38,6 @@ #define _MACHINE_ANSI_H_ /* - * Types which are fundamental to the implementation and may appear in - * more than one standard header are defined here. Standard headers - * then use: - * #ifdef _BSD_SIZE_T_ - * typedef _BSD_SIZE_T_ size_t; - * #undef _BSD_SIZE_T_ - * #endif - */ -#define _BSD_CLOCK_T_ int /* clock() */ -#define _BSD_FFLAGS_T_ __uint_least32_t /* file flags */ -#define _BSD_CLOCKID_T_ int /* clockid_t */ -#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */ -#define _BSD_PTRDIFF_T_ int /* ptr1 - ptr2 */ -#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */ -#define _BSD_SEGSZ_T_ __int32_t /* segment size (in pages) */ -#define _BSD_SIZE_T_ unsigned int /* sizeof() */ -#define _BSD_SOCKLEN_T_ __uint32_t /* socklen_t (duh) */ -#define _BSD_SSIZE_T_ long /* byte count or error */ -#define _BSD_TIME_T_ int /* time() */ -#define _BSD_TIMER_T_ int /* timer_t */ -#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */ -#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t (see below) */ - -/* - * Types which are fundamental to the implementation and must be used - * in more than one standard header although they are only declared in - * one (perhaps nonstandard) header are defined here. Standard headers - * use _BSD_XXX_T_ without undef'ing it. - */ -#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */ -#define _BSD_OFF_T_ __int64_t /* file offset */ -#define _BSD_PID_T_ int /* process [group] */ - -#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) -#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */ -#else -typedef struct { - char __gpr; - char __fpr; - char __pad[2]; - char *__stack; - char *__base; -} __va_list; -#define _BSD_VA_LIST_ __va_list /* va_list */ -#endif /* post GCC 2.95 */ -#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - -/* - * The rune type above 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 _BSD_CT_RUNE_T_ instead of int. By changing it - * here, you lose a bit of ANSI conformance, but your programs will still - * work. - * - * NOTE: rune_t is not covered by ANSI nor other standards, and should not - * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and - * rune_t must be the same type. Also wint_t must be no narrower than - * wchar_t, and should also be able to hold all members of the largest - * character set plus one extra value (WEOF). wint_t must be at least 16 bits. - */ - -/* * Frequencies of the clock ticks reported by clock() and times(). They * are the same as stathz for bogus historical reasons. They should be * 1e6 because clock() and times() are implemented using getrusage() and @@ -119,50 +50,4 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ #define _BSD_CLK_TCK_ 100 #define _BSD_CLOCKS_PER_SEC_ 100 -/* - * Internal names for basic integral types. Omit the typedef if - * not possible for a machine/compiler combination. - */ -typedef __signed char __int8_t; -typedef unsigned char __uint8_t; -typedef short __int16_t; -typedef unsigned short __uint16_t; -typedef int __int32_t; -typedef unsigned int __uint32_t; -typedef long long __int64_t; -typedef unsigned long long __uint64_t; - -typedef int __intptr_t; -typedef unsigned int __uintptr_t; - -typedef __signed char __int_least8_t; -typedef unsigned char __uint_least8_t; -typedef short __int_least16_t; -typedef unsigned short __uint_least16_t; -typedef int __int_least32_t; -typedef unsigned int __uint_least32_t; -typedef long long __int_least64_t; -typedef unsigned long long __uint_least64_t; - -typedef int __int_fast8_t; -typedef unsigned int __uint_fast8_t; -typedef int __int_fast16_t; -typedef unsigned int __uint_fast16_t; -typedef int __int_fast32_t; -typedef unsigned int __uint_fast32_t; -typedef long long __int_fast64_t; -typedef unsigned long long __uint_fast64_t; - -typedef long long __intmax_t; -typedef unsigned long long __uintmax_t; - -/* - * mbstate_t is an opaque object to keep conversion state, during multibyte - * stream conversions. The content must not be referenced by user programs. - */ -typedef union { - char __mbstate8[128]; - __int64_t _mbstateL; /* for alignment */ -} __mbstate_t; - -#endif /* _MACHINE_ANSI_H_ */ +#endif /* !_MACHINE_ANSI_H_ */ diff --git a/sys/powerpc/include/endian.h b/sys/powerpc/include/endian.h index fc33095..a0f08a0 100644 --- a/sys/powerpc/include/endian.h +++ b/sys/powerpc/include/endian.h @@ -39,7 +39,7 @@ #define _MACHINE_ENDIAN_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> /* * Define the order of 32-bit words in 64-bit words. diff --git a/sys/powerpc/include/stdarg.h b/sys/powerpc/include/stdarg.h index 87b5965..f71971d 100644 --- a/sys/powerpc/include/stdarg.h +++ b/sys/powerpc/include/stdarg.h @@ -31,9 +31,9 @@ #ifndef _POWERPC_STDARG_H_ #define _POWERPC_STDARG_H_ -#include <machine/ansi.h> +#include <sys/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) diff --git a/sys/powerpc/include/types.h b/sys/powerpc/include/types.h deleted file mode 100644 index 6ea3f31..0000000 --- a/sys/powerpc/include/types.h +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * 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 - * 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. - * - * @(#)types.h 8.3 (Berkeley) 1/5/94 - * $FreeBSD$ - */ - -#ifndef _MACHTYPES_H_ -#define _MACHTYPES_H_ - -#include <sys/cdefs.h> - -typedef unsigned int vm_offset_t; -typedef __int64_t vm_ooffset_t; -typedef __uint64_t vm_pindex_t; -typedef unsigned int vm_size_t; - -typedef __int32_t register_t; -typedef __uint32_t u_register_t; - -#ifdef _KERNEL -typedef int intfptr_t; -typedef unsigned int uintfptr_t; -#endif - -/* Critical section value */ -typedef register_t critical_t; - -/* Interrupt mask (spl, xxx_imask, etc) */ -typedef __uint32_t intrmask_t; - -#endif /* _MACHTYPES_H_ */ diff --git a/sys/powerpc/include/varargs.h b/sys/powerpc/include/varargs.h index 6e0f346..6ac271a 100644 --- a/sys/powerpc/include/varargs.h +++ b/sys/powerpc/include/varargs.h @@ -33,9 +33,9 @@ #if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) -#include <machine/ansi.h> +#include <sys/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; typedef int __builtin_va_alist_t __attribute__((__mode__(__word__))); #define va_alist __builtin_va_alist diff --git a/sys/sparc64/include/_types.h b/sys/sparc64/include/_types.h new file mode 100644 index 0000000..0e6d6ae --- /dev/null +++ b/sys/sparc64/include/_types.h @@ -0,0 +1,143 @@ +/*- + * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> + * 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 + * 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: @(#)ansi.h 8.2 (Berkeley) 1/4/94 + * From: @(#)types.h 8.3 (Berkeley) 1/5/94 + * $FreeBSD$ + */ + +#ifndef _MACHINE__TYPES_H_ +#define _MACHINE__TYPES_H_ + +/* + * Basic types upon which most other types are built. + */ +typedef __signed char __int8_t; +typedef unsigned char __uint8_t; +typedef short __int16_t; +typedef unsigned short __uint16_t; +typedef int __int32_t; +typedef unsigned int __uint32_t; +typedef long __int64_t; +typedef unsigned long __uint64_t; + +/* + * Standard type definitions. + */ +typedef __int32_t __clock_t; /* clock()... */ +typedef __int32_t __clockid_t; /* clock_gettime()... */ +typedef __int64_t __critical_t; +typedef __uint32_t __fflags_t; /* file flags */ +typedef __int64_t __intfptr_t; +typedef __int64_t __intmax_t; +typedef __int64_t __intptr_t; +typedef __uint32_t __intrmask_t; +typedef __int32_t __int_fast8_t; +typedef __int32_t __int_fast16_t; +typedef __int32_t __int_fast32_t; +typedef __int64_t __int_fast64_t; +typedef __int8_t __int_least8_t; +typedef __int16_t __int_least16_t; +typedef __int32_t __int_least32_t; +typedef __int64_t __int_least64_t; +typedef __int64_t __off_t; /* file offset */ +typedef __int32_t __pid_t; /* process [group] */ +typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ +typedef __int64_t __register_t; +typedef __int64_t __segsz_t; /* segment size (in pages) */ +typedef __uint64_t __size_t; /* sizeof() */ +typedef __uint32_t __socklen_t; +typedef __int64_t __ssize_t; /* byte count or error */ +typedef __int32_t __time_t; /* time()... */ +typedef __int32_t __timer_t; /* timer_gettime()... */ +typedef __uint64_t __uintfptr_t; +typedef __uint64_t __uintmax_t; +typedef __uint64_t __uintptr_t; +typedef __uint32_t __uint_fast8_t; +typedef __uint32_t __uint_fast16_t; +typedef __uint32_t __uint_fast32_t; +typedef __uint64_t __uint_fast64_t; +typedef __uint8_t __uint_least8_t; +typedef __uint16_t __uint_least16_t; +typedef __uint32_t __uint_least32_t; +typedef __uint64_t __uint_least64_t; +typedef __uint64_t __u_register_t; +typedef __uint64_t __vm_offset_t; +typedef __int64_t __vm_ooffset_t; +typedef __uint64_t __vm_pindex_t; +typedef __uint64_t __vm_size_t; + +/* + * Unusual type definitions. + */ +/* + * The rune type above 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 __ct_rune_t instead of int. By changing it here, you + * lose a bit of ANSI conformance, but your programs will still work. + * + * NOTE: rune_t is not covered by ANSI nor other standards, and should not + * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and + * rune_t must be the same type. Also wint_t must be no narrower than + * wchar_t, and should also be able to hold all members of the largest + * character set plus one extra value (WEOF). wint_t must be at least 16 bits. + */ +typedef __int32_t __ct_rune_t; +typedef __int32_t __rune_t; +typedef __int32_t __wchar_t; +typedef __int32_t __wint_t; + +/* + * mbstate_t is an opaque object to keep conversion state, during multibyte + * stream conversions. The content must not be referenced by user programs. + */ +typedef union { + char __mbstate8[128]; + __int64_t _mbstateL; /* for alignment */ +} __mbstate_t; + +#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) +typedef __builtin_va_list __va_list; /* internally known to gcc */ +#else +typedef char * __va_list; +#endif /* post GCC 2.95 */ +#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST) +#define __GNUC_VA_LIST +typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ +#endif + +#endif /* !_MACHINE__TYPES_H_ */ diff --git a/sys/sparc64/include/ansi.h b/sys/sparc64/include/ansi.h index 86f2cf6..11dbf03 100644 --- a/sys/sparc64/include/ansi.h +++ b/sys/sparc64/include/ansi.h @@ -39,68 +39,6 @@ #define _MACHINE_ANSI_H_ /* - * Types which are fundamental to the implementation and may appear in - * more than one standard header are defined here. Standard headers - * then use: - * #ifdef _BSD_SIZE_T_ - * typedef _BSD_SIZE_T_ size_t; - * #undef _BSD_SIZE_T_ - * #endif - */ -#define _BSD_CLOCK_T_ int /* clock() */ -#define _BSD_CLOCKID_T_ int /* clock_gettime()... */ -#define _BSD_FFLAGS_T_ __uint_least32_t /* file flags */ -#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */ -#define _BSD_PTRDIFF_T_ long /* ptr1 - ptr2 */ -#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */ -#define _BSD_SEGSZ_T_ __int64_t /* segment size (in pages) */ -#define _BSD_SIZE_T_ unsigned long /* sizeof() */ -#define _BSD_SOCKLEN_T_ __uint32_t /* socklen_t (duh) */ -#define _BSD_SSIZE_T_ long /* byte count or error */ -#define _BSD_TIME_T_ int /* time()... */ -#define _BSD_TIMER_T_ int /* timer_gettime()... */ -#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */ -#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t (see below) */ - -/* - * Types which are fundamental to the implementation and must be used - * in more than one standard header although they are only declared in - * one (perhaps nonstandard) header are defined here. Standard headers - * use _BSD_XXX_T_ without undef'ing it. - */ -#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */ -#define _BSD_OFF_T_ long /* file offset */ -#define _BSD_PID_T_ int /* process [group] */ - -#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) -#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */ -#else -#define _BSD_VA_LIST_ char * /* va_list */ -#endif /* post GCC 2.95 */ -#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - -/* - * The rune type above 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 _BSD_CT_RUNE_T_ instead of int. By changing it - * here, you lose a bit of ANSI conformance, but your programs will still - * work. - * - * NOTE: rune_t is not covered by ANSI nor other standards, and should not - * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and - * rune_t must be the same type. Also wint_t must be no narrower than - * wchar_t, and should also be able to hold all members of the largest - * character set plus one extra value (WEOF). wint_t must be at least 16 bits. - */ - -/* * Frequencies of the clock ticks reported by clock() and times(). They * are the same as stathz for bogus historical reasons. They should be * 1e6 because clock() and times() are implemented using getrusage() and @@ -113,50 +51,4 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ #define _BSD_CLK_TCK_ 100 #define _BSD_CLOCKS_PER_SEC_ 100 -/* - * Internal names for basic integral types. Omit the typedef if - * not possible for a machine/compiler combination. - */ -typedef __signed char __int8_t; -typedef unsigned char __uint8_t; -typedef short __int16_t; -typedef unsigned short __uint16_t; -typedef int __int32_t; -typedef unsigned int __uint32_t; -typedef long __int64_t; -typedef unsigned long __uint64_t; - -typedef long __intptr_t; -typedef unsigned long __uintptr_t; - -typedef __signed char __int_least8_t; -typedef unsigned char __uint_least8_t; -typedef short __int_least16_t; -typedef unsigned short __uint_least16_t; -typedef int __int_least32_t; -typedef unsigned int __uint_least32_t; -typedef long __int_least64_t; -typedef unsigned long __uint_least64_t; - -typedef int __int_fast8_t; -typedef unsigned int __uint_fast8_t; -typedef int __int_fast16_t; -typedef unsigned int __uint_fast16_t; -typedef int __int_fast32_t; -typedef unsigned int __uint_fast32_t; -typedef long __int_fast64_t; -typedef unsigned long __uint_fast64_t; - -typedef long __intmax_t; -typedef unsigned long __uintmax_t; - -/* - * mbstate_t is an opaque object to keep conversion state, during multibyte - * stream conversions. The content must not be referenced by user programs. - */ -typedef union { - char __mbstate8[128]; - __int64_t _mbstateL; /* for alignment */ -} __mbstate_t; - #endif /* !_MACHINE_ANSI_H_ */ diff --git a/sys/sparc64/include/endian.h b/sys/sparc64/include/endian.h index 830cf2e..e8ee184 100644 --- a/sys/sparc64/include/endian.h +++ b/sys/sparc64/include/endian.h @@ -38,7 +38,7 @@ #define _MACHINE_ENDIAN_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> /* * Define the order of 32-bit words in 64-bit words. diff --git a/sys/sparc64/include/stdarg.h b/sys/sparc64/include/stdarg.h index c126af0..f81a67c 100644 --- a/sys/sparc64/include/stdarg.h +++ b/sys/sparc64/include/stdarg.h @@ -41,9 +41,9 @@ #ifndef _MACHINE_STDARG_H_ #define _MACHINE_STDARG_H_ -#include <machine/ansi.h> +#include <sys/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) diff --git a/sys/sparc64/include/types.h b/sys/sparc64/include/types.h deleted file mode 100644 index 3d0439f..0000000 --- a/sys/sparc64/include/types.h +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * 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 - * 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. - * - * @(#)types.h 8.3 (Berkeley) 1/5/94 - * $FreeBSD$ - */ - -#ifndef _MACHINE_TYPES_H_ -#define _MACHINE_TYPES_H_ - -#include <sys/cdefs.h> - -typedef unsigned long vm_offset_t; -typedef long vm_ooffset_t; -typedef unsigned long vm_pindex_t; -typedef unsigned long vm_size_t; - -typedef __int64_t register_t; -typedef __uint64_t u_register_t; - -#ifdef _KERNEL -typedef long intfptr_t; -typedef unsigned long uintfptr_t; -#endif - -/* Critical section value */ -typedef register_t critical_t; - -/* Interrupt mask (spl, xxx_imask, etc) */ -typedef __uint32_t intrmask_t; - -#endif /* !_MACHINE_TYPES_H_ */ diff --git a/sys/sparc64/include/varargs.h b/sys/sparc64/include/varargs.h index dd7e3a3..a93b89f 100644 --- a/sys/sparc64/include/varargs.h +++ b/sys/sparc64/include/varargs.h @@ -51,9 +51,9 @@ #if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3) -#include <machine/ansi.h> +#include <sys/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; typedef int __builtin_va_alist_t __attribute__((__mode__(__word__))); #define va_alist __builtin_va_alist diff --git a/sys/sys/_timespec.h b/sys/sys/_timespec.h index 69b8fdd..48cef5a 100644 --- a/sys/sys/_timespec.h +++ b/sys/sys/_timespec.h @@ -36,7 +36,7 @@ */ /* - * Prerequisites: <sys/cdefs.h>, <machine/ansi.h> + * Prerequisites: <sys/cdefs.h>, <sys/_types.h> * * This file must be kept synchronized with <sys/timespec.h>. * It defines a structure which must be a type pun for @@ -49,8 +49,8 @@ #define _SYS__TIMESPEC_H_ struct __timespec { -#ifdef _BSD_TIME_T_ - _BSD_TIME_T_ __tv_sec; /* seconds, but time_t is not yet defined */ +#ifndef _TIME_T_DECLARED + __time_t __tv_sec; /* seconds, but time_t is not yet defined */ #else time_t __tv_sec; /* seconds */ #endif diff --git a/sys/sys/_types.h b/sys/sys/_types.h index cbc430b..864ba71 100644 --- a/sys/sys/_types.h +++ b/sys/sys/_types.h @@ -30,12 +30,12 @@ #define _SYS__TYPES_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> -#define _BSD_FSBLKCNT_T_ __uint64_t -#define _BSD_FSFILCNT_T_ __uint64_t -#define _BSD_GID_T_ __uint32_t -#define _BSD_SA_FAMILY_T_ __uint8_t -#define _BSD_UID_T_ __uint32_t +typedef __uint64_t __fsblkcnt_t; +typedef __uint64_t __fsfilcnt_t; +typedef __uint32_t __gid_t; +typedef __uint8_t __sa_family_t; +typedef __uint32_t __uid_t; #endif /* !_SYS__TYPES_H_ */ diff --git a/sys/sys/dirent.h b/sys/sys/dirent.h index b9c39d1..9f8cfad 100644 --- a/sys/sys/dirent.h +++ b/sys/sys/dirent.h @@ -37,7 +37,7 @@ #ifndef _SYS_DIRENT_H_ #define _SYS_DIRENT_H_ -#include <machine/ansi.h> +#include <sys/_types.h> /* * The dirent structure defines the format of directory entries returned by diff --git a/sys/sys/sbuf.h b/sys/sys/sbuf.h index bd2e9e9..a63603e 100644 --- a/sys/sys/sbuf.h +++ b/sys/sys/sbuf.h @@ -31,7 +31,7 @@ #ifndef _SYS_SBUF_H_ #define _SYS_SBUF_H_ -#include <machine/ansi.h> +#include <sys/_types.h> /* * Structure definition @@ -63,7 +63,7 @@ int sbuf_bcpy(struct sbuf *, const char *, size_t); int sbuf_cat(struct sbuf *, const char *); int sbuf_cpy(struct sbuf *, const char *); int sbuf_printf(struct sbuf *, const char *, ...) __printflike(2, 3); -int sbuf_vprintf(struct sbuf *, const char *, _BSD_VA_LIST_) __printflike(2, 0); +int sbuf_vprintf(struct sbuf *, const char *, __va_list) __printflike(2, 0); int sbuf_putc(struct sbuf *, int); int sbuf_trim(struct sbuf *); int sbuf_overflowed(struct sbuf *); diff --git a/sys/sys/signal.h b/sys/sys/signal.h index f0668a9..9098326 100644 --- a/sys/sys/signal.h +++ b/sys/sys/signal.h @@ -215,9 +215,9 @@ typedef void __siginfohandler_t(int, struct __siginfo *, void *); typedef __sighandler_t *sig_t; /* type of pointer to a signal function */ -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif /* diff --git a/sys/sys/socket.h b/sys/sys/socket.h index 4254c72..0f81be1 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -49,14 +49,14 @@ /* * Data types. */ -#ifdef _BSD_SA_FAMILY_T_ -typedef _BSD_SA_FAMILY_T_ sa_family_t; -#undef _BSD_SA_FAMILY_T_ +#ifndef _SA_FAMILY_T_DECLARED +typedef __sa_family_t sa_family_t; +#define _SA_FAMILY_T_DECLARED #endif -#ifdef _BSD_SOCKLEN_T_ -typedef _BSD_SOCKLEN_T_ socklen_t; -#undef _BSD_SOCKLEN_T_ +#ifndef _SOCKLEN_T_DECLARED +typedef __socklen_t socklen_t; +#define _SOCKLEN_T_DECLARED #endif /* diff --git a/sys/sys/stat.h b/sys/sys/stat.h index d7e28f3..a1d207f 100644 --- a/sys/sys/stat.h +++ b/sys/sys/stat.h @@ -43,11 +43,11 @@ #define _SYS_STAT_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> -#ifdef _BSD_FFLAGS_T_ -typedef _BSD_FFLAGS_T_ fflags_t; /* file flags */ -#undef _BSD_FFLAGS_T_ +#ifndef _FFLAGS_T_DECLARED +typedef __fflags_t fflags_t; /* file flags */ +#define _FFLAGS_T_DECLARED #endif #if !defined(_KERNEL) && !defined(_POSIX_SOURCE) diff --git a/sys/sys/statvfs.h b/sys/sys/statvfs.h index ef722c1..15be8ce 100644 --- a/sys/sys/statvfs.h +++ b/sys/sys/statvfs.h @@ -43,8 +43,8 @@ * a quality implementation should.) */ #ifndef _FSBLKCNT_T_DECLARED /* always declared together */ -typedef _BSD_FSBLKCNT_T_ fsblkcnt_t; -typedef _BSD_FSFILCNT_T_ fsfilcnt_t; +typedef __fsblkcnt_t fsblkcnt_t; +typedef __fsfilcnt_t fsfilcnt_t; #define _FSBLKCNT_T_DECLARED #endif diff --git a/sys/sys/stdint.h b/sys/sys/stdint.h index 1f870fc..27f6dae 100644 --- a/sys/sys/stdint.h +++ b/sys/sys/stdint.h @@ -30,8 +30,8 @@ #define _SYS_STDINT_H_ #include <sys/cdefs.h> +#include <sys/_types.h> -#include <machine/ansi.h> #include <machine/_stdint.h> #ifndef _INT8_T_DECLARED diff --git a/sys/sys/syslog.h b/sys/sys/syslog.h index 80cac0a..2b45ca4 100644 --- a/sys/sys/syslog.h +++ b/sys/sys/syslog.h @@ -186,17 +186,17 @@ CODE facilitynames[] = { * places (<machine/varargs.h> and <machine/stdarg.h>), 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 syslog.h, so we get - * _BSD_VA_LIST_ from <machine/ansi.h> and use it. + * __va_list from <sys/_types.h> and use it. */ -#include <machine/ansi.h> #include <sys/cdefs.h> +#include <sys/_types.h> __BEGIN_DECLS void closelog(void); void openlog(const char *, int, int); int setlogmask(int); void syslog(int, const char *, ...) __printflike(2, 3); -void vsyslog(int, const char *, _BSD_VA_LIST_) __printflike(2, 0); +void vsyslog(int, const char *, __va_list) __printflike(2, 0); __END_DECLS #endif /* !_KERNEL */ diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 597f58e..2029412 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -143,19 +143,19 @@ void init_param1(void); void init_param2(int physpages); void tablefull(const char *); int kvprintf(char const *, void (*)(int, void*), void *, int, - _BSD_VA_LIST_) __printflike(1, 0); + __va_list) __printflike(1, 0); void log(int, const char *, ...) __printflike(2, 3); void log_console(struct uio *); int printf(const char *, ...) __printflike(1, 2); int snprintf(char *, size_t, const char *, ...) __printflike(3, 4); int sprintf(char *buf, const char *, ...) __printflike(2, 3); int uprintf(const char *, ...) __printflike(1, 2); -int vprintf(const char *, _BSD_VA_LIST_) __printflike(1, 0); -int vsnprintf(char *, size_t, const char *, _BSD_VA_LIST_) __printflike(3, 0); -int vsprintf(char *buf, const char *, _BSD_VA_LIST_) __printflike(2, 0); +int vprintf(const char *, __va_list) __printflike(1, 0); +int vsnprintf(char *, size_t, const char *, __va_list) __printflike(3, 0); +int vsprintf(char *buf, const char *, __va_list) __printflike(2, 0); int ttyprintf(struct tty *, const char *, ...) __printflike(2, 3); int sscanf(const char *, char const *, ...); -int vsscanf(const char *, char const *, _BSD_VA_LIST_); +int vsscanf(const char *, char const *, __va_list); long strtol(const char *, char **, int); u_long strtoul(const char *, char **, int); quad_t strtoq(const char *, char **, int); diff --git a/sys/sys/times.h b/sys/sys/times.h index eb68bd0..dfa3124 100644 --- a/sys/sys/times.h +++ b/sys/sys/times.h @@ -42,11 +42,11 @@ #ifndef _SYS_TIMES_H_ #define _SYS_TIMES_H_ -#include <machine/ansi.h> +#include <sys/_types.h> -#ifdef _BSD_CLOCK_T_ -typedef _BSD_CLOCK_T_ clock_t; -#undef _BSD_CLOCK_T_ +#ifndef _CLOCK_T_DECLARED +typedef __clock_t clock_t; +#define _CLOCK_T_DECLARED #endif struct tms { diff --git a/sys/sys/timespec.h b/sys/sys/timespec.h index 038db28..9f17828 100644 --- a/sys/sys/timespec.h +++ b/sys/sys/timespec.h @@ -36,15 +36,15 @@ */ /* - * Prerequisites: <sys/cdefs.h>, <machine/ansi.h> + * Prerequisites: <sys/cdefs.h>, <sys/_types.h> */ #ifndef _SYS_TIMESPEC_H_ #define _SYS_TIMESPEC_H_ -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ +#ifndef _TIME_T_DECLARED +typedef __time_t time_t; +#define _TIME_T_DECLARED #endif struct timespec { diff --git a/sys/sys/types.h b/sys/sys/types.h index ded6f77..a0af2b9 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -45,9 +45,7 @@ #include <sys/cdefs.h> /* Machine type dependent parameters. */ -#include <machine/ansi.h> #include <machine/endian.h> -#include <machine/types.h> #include <sys/_types.h> #ifndef _POSIX_SOURCE @@ -126,36 +124,42 @@ typedef quad_t * qaddr_t; typedef char * caddr_t; /* core address */ typedef __const char * c_caddr_t; /* core address, pointer to const */ typedef __volatile char *v_caddr_t; /* core address, pointer to volatile */ +typedef __critical_t critical_t; /* Critical section value */ typedef int64_t daddr_t; /* disk address */ typedef u_int32_t fixpt_t; /* fixed point number */ -#ifdef _BSD_GID_T_ -typedef _BSD_GID_T_ gid_t; /* group id */ -#undef _BSD_GID_T_ +#ifndef _GID_T_DECLARED +typedef __gid_t gid_t; /* group id */ +#define _GID_T_DECLARED #endif typedef u_int32_t ino_t; /* inode number */ +typedef __intrmask_t intrmask_t; /* Interrupt mask (spl, xxx_imask...) */ typedef long key_t; /* IPC key (for Sys V IPC) */ typedef u_int16_t mode_t; /* permissions */ typedef u_int16_t nlink_t; /* link count */ -typedef _BSD_OFF_T_ off_t; /* file offset */ -typedef _BSD_PID_T_ pid_t; /* process id */ +typedef __off_t off_t; /* file offset */ +typedef __pid_t pid_t; /* process id */ +typedef __register_t register_t; typedef quad_t rlim_t; /* resource limit */ - -#ifdef _BSD_SEGSZ_T_ -typedef _BSD_SEGSZ_T_ segsz_t; /* segment size (in pages) */ -#undef _BSD_SEGSZ_T_ -#endif - +typedef __segsz_t segsz_t; /* segment size (in pages) */ typedef int32_t swblk_t; /* swap offset */ +typedef __u_register_t u_register_t; -#ifdef _BSD_UID_T_ -typedef _BSD_UID_T_ uid_t; /* user id */ -#undef _BSD_UID_T_ +#ifndef _UID_T_DECLARED +typedef __uid_t uid_t; /* user id */ +#define _UID_T_DECLARED #endif +typedef __vm_offset_t vm_offset_t; +typedef __vm_ooffset_t vm_ooffset_t; +typedef __vm_pindex_t vm_pindex_t; +typedef __vm_size_t vm_size_t; + #ifdef _KERNEL typedef int boolean_t; +typedef __intfptr_t intfptr_t; +typedef __uintfptr_t uintfptr_t; typedef u_int64_t uoff_t; typedef struct vm_page *vm_page_t; @@ -186,45 +190,45 @@ typedef u_int32_t dev_t; /* device number */ #endif /* !_KERNEL */ -#ifdef _BSD_CLOCK_T_ -typedef _BSD_CLOCK_T_ clock_t; -#undef _BSD_CLOCK_T_ +#ifndef _CLOCK_T_DECLARED +typedef __clock_t clock_t; +#define _CLOCK_T_DECLARED #endif -#ifdef _BSD_CLOCKID_T_ -typedef _BSD_CLOCKID_T_ clockid_t; -#undef _BSD_CLOCKID_T_ +#ifndef _CLOCKID_T_DECLARED +typedef __clockid_t clockid_t; +#define _CLOCKID_T_DECLARED #endif -#ifdef _BSD_FFLAGS_T_ -typedef _BSD_FFLAGS_T_ fflags_t; /* file flags */ -#undef _BSD_FFLAGS_T_ +#ifndef _FFLAGS_T_DECLARED +typedef __fflags_t fflags_t; /* file flags */ +#define _FFLAGS_T_DECLARED #endif #ifndef _FSBLKCNT_T_DECLARED /* for statvfs() */ -typedef _BSD_FSBLKCNT_T_ fsblkcnt_t; -typedef _BSD_FSFILCNT_T_ fsfilcnt_t; -#define _FSBLKCNT_T_DECLARED +typedef __fsblkcnt_t fsblkcnt_t; +typedef __fsfilcnt_t fsfilcnt_t; +#define _FSBLKCNT_T_DECLARED #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif -#ifdef _BSD_SSIZE_T_ -typedef _BSD_SSIZE_T_ ssize_t; -#undef _BSD_SSIZE_T_ +#ifndef _SSIZE_T_DECLARED +typedef __ssize_t ssize_t; +#define _SSIZE_T_DECLARED #endif -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ +#ifndef _TIME_T_DECLARED +typedef __time_t time_t; +#define _TIME_T_DECLARED #endif -#ifdef _BSD_TIMER_T_ -typedef _BSD_TIMER_T_ timer_t; -#undef _BSD_TIMER_T_ +#ifndef _TIMER_T_DECLARED +typedef __timer_t timer_t; +#define _TIMER_T_DECLARED #endif #if __BSD_VISIBLE diff --git a/sys/sys/un.h b/sys/sys/un.h index 65d246b6..12ca360 100644 --- a/sys/sys/un.h +++ b/sys/sys/un.h @@ -40,9 +40,9 @@ #include <sys/cdefs.h> #include <sys/_types.h> -#ifdef _BSD_SA_FAMILY_T_ -typedef _BSD_SA_FAMILY_T_ sa_family_t; -#undef _BSD_SA_FAMILY_T_ +#ifndef _SA_FAMILY_T_DECLARED +typedef __sa_family_t sa_family_t; +#define _SA_FAMILY_T_DECLARED #endif /* diff --git a/usr.sbin/ppp/prompt.h b/usr.sbin/ppp/prompt.h index 6569cd9..5d25c45 100644 --- a/usr.sbin/ppp/prompt.h +++ b/usr.sbin/ppp/prompt.h @@ -76,10 +76,10 @@ extern void prompt_Printf(struct prompt *, const char *, ...) extern void prompt_Printf(struct prompt *, const char *, ...); #endif #ifdef __GNUC__ -extern void prompt_vPrintf(struct prompt *, const char *, _BSD_VA_LIST_) +extern void prompt_vPrintf(struct prompt *, const char *, __va_list) __attribute__ ((format (printf, 2, 0))); #else -extern void prompt_vPrintf(struct prompt *, const char *, _BSD_VA_LIST_); +extern void prompt_vPrintf(struct prompt *, const char *, __va_list); #endif #define PROMPT_DONT_WANT_INT 1 #define PROMPT_WANT_INT 0 |