diff options
author | mike <mike@FreeBSD.org> | 2002-04-01 08:12:25 +0000 |
---|---|---|
committer | mike <mike@FreeBSD.org> | 2002-04-01 08:12:25 +0000 |
commit | beecc37c73ebf8cf27e26fe5fc3a80fd02535ac4 (patch) | |
tree | eff013810ee5bdc57f51e401f7ec54272cb4fafe /include | |
parent | f4cfa354ba07ca7cd849efb0cff903ac831f247a (diff) | |
download | FreeBSD-src-beecc37c73ebf8cf27e26fe5fc3a80fd02535ac4.zip FreeBSD-src-beecc37c73ebf8cf27e26fe5fc3a80fd02535ac4.tar.gz |
o Implement <sys/_types.h>, a new header for storing types that are
MI, not required to be a fixed size, and used in multiple headers.
This will grow in time, as more things move here from <sys/types.h>
and <machine/ansi.h>.
o Add missing type definitions (uint16_t and uint32_t) to
<arpa/inet.h> and <netinet/in.h>.
o Reduce pollution in <sys/types.h> by using `#if _FOO_T_DECLARED'
widgets to avoid including <sys/stdint.h>.
o Add some missing type definitions to <unistd.h> and note the ones
that still need to be added.
o Make use of <sys/_types.h> primitives in <grp.h> and <sys/types.h>.
Reviewed by: bde
Diffstat (limited to 'include')
-rw-r--r-- | include/arpa/inet.h | 34 | ||||
-rw-r--r-- | include/grp.h | 6 | ||||
-rw-r--r-- | include/unistd.h | 27 |
3 files changed, 49 insertions, 18 deletions
diff --git a/include/arpa/inet.h b/include/arpa/inet.h index 5a0e814..1a69363 100644 --- a/include/arpa/inet.h +++ b/include/arpa/inet.h @@ -72,14 +72,24 @@ #define INET6_ADDRSTRLEN 46 #endif -#ifndef _IN_ADDR_T_DECLARED_ -typedef __uint32_t in_addr_t; -#define _IN_ADDR_T_DECLARED_ +#ifndef _UINT16_T_DECLARED +typedef __uint16_t uint16_t; +#define _UINT16_T_DECLARED #endif -#ifndef _IN_PORT_T_DECLARED_ -typedef __uint16_t in_port_t; -#define _IN_PORT_T_DECLARED_ +#ifndef _UINT32_T_DECLARED +typedef __uint32_t uint32_t; +#define _UINT32_T_DECLARED +#endif + +#ifndef _IN_ADDR_T_DECLARED +typedef uint32_t in_addr_t; +#define _IN_ADDR_T_DECLARED +#endif + +#ifndef _IN_PORT_T_DECLARED +typedef uint16_t in_port_t; +#define _IN_PORT_T_DECLARED #endif #ifndef _POSIX_SOURCE @@ -105,10 +115,6 @@ struct in_addr { #define _STRUCT_IN_ADDR_DECLARED #endif -/* - * XXX missing typedefs for uint16_t and uint32_t. - */ - /* XXX all new diversions!! argh!! */ #ifndef _POSIX_SOURCE #define inet_addr __inet_addr @@ -130,10 +136,10 @@ struct in_addr { __BEGIN_DECLS #ifndef _BYTEORDER_PROTOTYPED #define _BYTEORDER_PROTOTYPED -__uint32_t htonl(__uint32_t); -__uint16_t htons(__uint16_t); -__uint32_t ntohl(__uint32_t); -__uint16_t ntohs(__uint16_t); +uint32_t htonl(uint32_t); +uint16_t htons(uint16_t); +uint32_t ntohl(uint32_t); +uint16_t ntohs(uint16_t); #endif in_addr_t inet_addr(const char *); diff --git a/include/grp.h b/include/grp.h index 3919c05..cbb6215 100644 --- a/include/grp.h +++ b/include/grp.h @@ -49,9 +49,9 @@ #define _PATH_GROUP "/etc/group" #endif -#ifndef _GID_T_DECLARED -#define _GID_T_DECLARED -typedef __uint32_t gid_t; +#ifdef _BSD_GID_T_ +typedef _BSD_GID_T_ gid_t; +#undef _BSD_GID_T_ #endif struct group { diff --git a/include/unistd.h b/include/unistd.h index 3819e57..5538d11 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -38,8 +38,33 @@ #define _UNISTD_H_ #include <sys/cdefs.h> -#include <sys/types.h> +#include <sys/types.h> /* XXX adds too much pollution. */ #include <sys/unistd.h> +#include <sys/_types.h> + +#ifdef _BSD_GID_T_ +typedef _BSD_GID_T_ gid_t; +#undef _BSD_GID_T_ +#endif + +#ifdef _BSD_SIZE_T_ +typedef _BSD_SIZE_T_ size_t; +#undef _BSD_SIZE_T_ +#endif + +#ifdef _BSD_SSIZE_T_ +typedef _BSD_SSIZE_T_ ssize_t; +#undef _BSD_SSIZE_T_ +#endif + +#ifdef _BSD_UID_T_ +typedef _BSD_UID_T_ uid_t; +#undef _BSD_UID_T_ +#endif + +/* + * XXX missing type definitions for off_t, pid_t and useconds_t. + */ #define STDIN_FILENO 0 /* standard input file descriptor */ #define STDOUT_FILENO 1 /* standard output file descriptor */ |