From 6ecfb2faec4c2a98c30079c69c9ba5d51cf549f7 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Thu, 9 Feb 2017 20:12:00 +0100 Subject: [PATCH] : Namespace cleanup. Don't include the full . Include and derive the types which and need from the __* versions. just needs __size_t, which is in . This commit also fixes a circular #include where was including and vice versa. --- sys/sys/_iovec.h | 2 +- sys/sys/_timespec.h | 7 ++++++- sys/sys/_timeval.h | 14 +++++++++++--- sys/sys/types.h | 5 ++++- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/sys/sys/_iovec.h b/sys/sys/_iovec.h index 8ec964a079..8fa51db1d1 100644 --- a/sys/sys/_iovec.h +++ b/sys/sys/_iovec.h @@ -33,7 +33,7 @@ #ifndef _SYS__IOVEC_H_ #define _SYS__IOVEC_H_ -#include +#include #ifndef _SIZE_T_DECLARED typedef __size_t size_t; diff --git a/sys/sys/_timespec.h b/sys/sys/_timespec.h index a4630b4c3e..eabddf8c25 100644 --- a/sys/sys/_timespec.h +++ b/sys/sys/_timespec.h @@ -32,7 +32,12 @@ #ifndef _SYS__TIMESPEC_H_ #define _SYS__TIMESPEC_H_ -#include +#include + +#ifndef _TIME_T_DECLARED +typedef __time_t time_t; +#define _TIME_T_DECLARED +#endif struct timespec { time_t tv_sec; /* seconds */ diff --git a/sys/sys/_timeval.h b/sys/sys/_timeval.h index e20cf9f75a..1b4aae553d 100644 --- a/sys/sys/_timeval.h +++ b/sys/sys/_timeval.h @@ -27,14 +27,22 @@ * 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. - * - * $DragonFly: src/sys/sys/_timeval.h,v 1.1 2008/06/18 09:36:07 hasso Exp $ */ #ifndef _SYS__TIMEVAL_H_ #define _SYS__TIMEVAL_H_ -#include +#include + +#ifndef _SUSECONDS_T_DECLARED +typedef long suseconds_t; +#define _SUSECONDS_T_DECLARED +#endif + +#ifndef _TIME_T_DECLARED +typedef __time_t time_t; +#define _TIME_T_DECLARED +#endif /* * Structure returned by gettimeofday(2) system call and used in other calls. diff --git a/sys/sys/types.h b/sys/sys/types.h index d7e8b9ce54..41155fd6cd 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -108,11 +108,14 @@ typedef __pid_t pid_t; /* process id */ typedef __pid_t lwpid_t; /* light weight process id */ typedef quad_t rlim_t; /* resource limit */ typedef __segsz_t segsz_t; /* segment size */ +#ifndef _SUSECONDS_T_DECLARED +typedef long suseconds_t; /* microseconds (signed) */ +#define _SUSECONDS_T_DECLARED +#endif #ifndef _UID_T_DECLARED typedef __uint32_t uid_t; /* user id */ #define _UID_T_DECLARED #endif -typedef long suseconds_t; /* microseconds (signed) */ typedef __uint32_t useconds_t; /* microseconds (unsigned) */ typedef int mqd_t; /* message queue descriptor */ -- 2.41.0