Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/include Over the years this header gained a lot of disparate...
details: https://anonhg.NetBSD.org/src/rev/55889d1b54a9
branches: trunk
changeset: 782519:55889d1b54a9
user: christos <christos%NetBSD.org@localhost>
date: Sun Nov 04 23:25:59 2012 +0000
description:
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.
diffstat:
include/util.h | 29 +++++++++++++++++------------
1 files changed, 17 insertions(+), 12 deletions(-)
diffs (63 lines):
diff -r d3be6142fe3b -r 55889d1b54a9 include/util.h
--- a/include/util.h Sun Nov 04 22:55:07 2012 +0000
+++ b/include/util.h Sun Nov 04 23:25:59 2012 +0000
@@ -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 passwd;
struct termios;
struct utmp;
+struct utmpx;
struct winsize;
struct sockaddr;
@@ -147,8 +152,8 @@
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_ */
Home |
Main Index |
Thread Index |
Old Index