From 834dcade3083410d1d52d062f4f1962ddaf59f08 Mon Sep 17 00:00:00 2001 From: Mike Barcroft Date: Tue, 26 Feb 2002 19:43:03 +0000 Subject: [PATCH] Rather than include namespace pollution in in order to declare `gid_t', use the canonical protection scheme to define a type in two or more headers. This brings closer to POSIX.1-2001 conformance. --- include/grp.h | 6 +++++- sys/sys/types.h | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/grp.h b/include/grp.h index abd88ef18153..07a4e454f2ec 100644 --- a/include/grp.h +++ b/include/grp.h @@ -42,13 +42,17 @@ #ifndef _GRP_H_ #define _GRP_H_ -#include #include #ifndef _POSIX_SOURCE #define _PATH_GROUP "/etc/group" #endif +#ifndef _GID_T_DECLARED +#define _GID_T_DECLARED +typedef u_int32_t gid_t; +#endif + struct group { char *gr_name; /* group name */ char *gr_passwd; /* group password */ diff --git a/sys/sys/types.h b/sys/sys/types.h index e80462baa948..db3c04d78ba2 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -73,7 +73,12 @@ typedef __volatile char *v_caddr_t; /* core address, pointer to volatile */ typedef int32_t daddr_t; /* disk address */ typedef u_int32_t u_daddr_t; /* unsigned disk address */ typedef u_int32_t fixpt_t; /* fixed point number */ + +#ifndef _GID_T_DECLARED +#define _GID_T_DECLARED typedef u_int32_t gid_t; /* group id */ +#endif + typedef u_int32_t ino_t; /* inode number */ typedef long key_t; /* IPC key (for Sys V IPC) */ typedef u_int16_t mode_t; /* permissions */