Module Name: src Committed By: christos Date: Sun Nov 4 23:25:59 UTC 2012
Modified Files: src/include: util.h Log Message: Over the years this header gained a lot of disparate functionality and willy nilly people kept adding headers appropriate to the new functionality So we reached where we are today, this header causes lots of namespace conflicts (for example you cannot use util.h from a lex file, because ECHO is macro used in lex, and ECHO is defined to 8 in termios). Roll back time, and remove all the unnecessary includes, leaving it to the program to include the ancillary headers they need. To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/include/util.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/include/util.h diff -u src/include/util.h:1.63 src/include/util.h:1.64 --- src/include/util.h:1.63 Sat Apr 7 12:44:59 2012 +++ src/include/util.h Sun Nov 4 18:25:59 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: util.h,v 1.63 2012/04/07 16:44:59 christos Exp $ */ +/* $NetBSD: util.h,v 1.64 2012/11/04 23:25:59 christos Exp $ */ /*- * Copyright (c) 1995 @@ -33,21 +33,25 @@ #define _UTIL_H_ #include <sys/cdefs.h> -#include <sys/ttycom.h> #include <sys/types.h> -#include <pwd.h> -#include <stdarg.h> -#include <stdio.h> -#include <termios.h> -#include <utmp.h> -#include <utmpx.h> -#include <stdint.h> -#include <machine/ansi.h> +#include <sys/ansi.h> +#include <sys/inttypes.h> #ifdef _BSD_TIME_T_ typedef _BSD_TIME_T_ time_t; #undef _BSD_TIME_T_ #endif +#ifdef _BSD_SIZE_T_ +typedef _BSD_SIZE_T_ size_t; +#undef _BSD_SIZE_T_ +#endif + +#if defined(_POSIX_C_SOURCE) +#ifndef __VA_LIST_DECLARED +typedef __va_list va_list; +#define __VA_LIST_DECLARED +#endif +#endif #define PIDLOCK_NONBLOCK 1 #define PIDLOCK_USEHOSTNAME 2 @@ -62,6 +66,7 @@ struct iovec; struct passwd; struct termios; struct utmp; +struct utmpx; struct winsize; struct sockaddr; @@ -147,8 +152,8 @@ void *erealloc(void *, size_t); struct __sFILE *efopen(const char *, const char *); int easprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3); -int evasprintf(char ** __restrict, const char * __restrict, va_list) - __printflike(2, 0); +int evasprintf(char ** __restrict, const char * __restrict, + __va_list) __printflike(2, 0); __END_DECLS #endif /* !_UTIL_H_ */