From 024ced04edda4bedf835ef15518539373acf3f16 Mon Sep 17 00:00:00 2001 From: christos Date: Wed, 29 Jul 2015 00:10:25 +0000 Subject: [PATCH] move stdbool.h to sys, reuire pool.h to include for bool, centralize definitions of bool, true, false, to --- include/Makefile | 4 ++-- sys/sys/Makefile | 7 ++++--- sys/sys/pool.h | 4 +++- {include => sys/sys}/stdbool.h | 10 ++++++---- sys/sys/types.h | 5 ++++- 5 files changed, 19 insertions(+), 11 deletions(-) rename {include => sys/sys}/stdbool.h (89%) diff --git a/include/Makefile b/include/Makefile index 0f94a2feefae..039e3f056d44 100644 --- a/include/Makefile +++ b/include/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.140 2013/12/11 01:24:08 joerg Exp $ +# $NetBSD: Makefile,v 1.141 2015/07/29 00:10:26 christos Exp $ # @(#)Makefile 8.2 (Berkeley) 1/4/94 # Doing a make includes builds /usr/include @@ -18,7 +18,7 @@ INCS= a.out.h aio.h ar.h assert.h atomic.h \ ndbm.h netconfig.h netdb.h netgroup.h nlist.h nl_types.h nsswitch.h \ paths.h pwd.h quota.h randomid.h ranlib.h re_comp.h regex.h regexp.h \ resolv.h res_update.h rmt.h sched.h search.h semaphore.h setjmp.h \ - string.h sgtty.h signal.h spawn.h stab.h stdbool.h stddef.h stdio.h \ + string.h sgtty.h signal.h spawn.h stab.h stddef.h stdio.h \ stdlib.h strings.h stringlist.h struct.h sysexits.h tar.h time.h \ ttyent.h tzfile.h ucontext.h ulimit.h unistd.h util.h utime.h utmp.h \ utmpx.h uuid.h vis.h wchar.h wctype.h wordexp.h diff --git a/sys/sys/Makefile b/sys/sys/Makefile index 57e9a552c856..c4b690d4d68b 100644 --- a/sys/sys/Makefile +++ b/sys/sys/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.154 2015/06/26 14:38:54 matt Exp $ +# $NetBSD: Makefile,v 1.155 2015/07/29 00:10:25 christos Exp $ .include @@ -37,8 +37,8 @@ INCS= acct.h agpio.h aio.h ansi.h aout_mids.h ataio.h atomic.h audioio.h \ sha2.h shm.h siginfo.h signal.h signalvar.h sigtypes.h \ sleepq.h socket.h \ socketvar.h sockio.h spawn.h specificdata.h stat.h \ - statvfs.h syscall.h syscallargs.h sysctl.h stdarg.h stdint.h swap.h \ - syncobj.h syslimits.h syslog.h \ + statvfs.h syscall.h syscallargs.h sysctl.h stdarg.h stdbool.h \ + stdint.h swap.h syncobj.h syslimits.h syslog.h \ tape.h termios.h time.h timeb.h timepps.h times.h \ timex.h tls.h trace.h tree.h tty.h ttychars.h ttycom.h \ ttydefaults.h ttydev.h types.h \ @@ -52,6 +52,7 @@ INCSYMLINKS=\ sys/fcntl.h /usr/include/fcntl.h \ sys/poll.h /usr/include/poll.h \ sys/stdarg.h /usr/include/stdarg.h \ + sys/stdbool.h /usr/include/stdbool.h \ sys/stdint.h /usr/include/stdint.h \ sys/syslog.h /usr/include/syslog.h \ sys/termios.h /usr/include/termios.h \ diff --git a/sys/sys/pool.h b/sys/sys/pool.h index f8de533f382d..37183709bd45 100644 --- a/sys/sys/pool.h +++ b/sys/sys/pool.h @@ -1,4 +1,4 @@ -/* $NetBSD: pool.h,v 1.78 2015/07/28 12:32:44 maxv Exp $ */ +/* $NetBSD: pool.h,v 1.79 2015/07/29 00:10:25 christos Exp $ */ /*- * Copyright (c) 1997, 1998, 1999, 2000, 2007 The NetBSD Foundation, Inc. @@ -32,6 +32,8 @@ #ifndef _SYS_POOL_H_ #define _SYS_POOL_H_ + +#include #include struct pool_sysctl { diff --git a/include/stdbool.h b/sys/sys/stdbool.h similarity index 89% rename from include/stdbool.h rename to sys/sys/stdbool.h index 966416bdf4a0..1689f60660b7 100644 --- a/include/stdbool.h +++ b/sys/sys/stdbool.h @@ -1,4 +1,4 @@ -/* $NetBSD: stdbool.h,v 1.5 2013/04/26 17:41:34 joerg Exp $ */ +/* $NetBSD: stdbool.h,v 1.1 2015/07/29 00:10:25 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -29,9 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _STDBOOL_H_ -#define _STDBOOL_H_ +#ifndef _SYS_STDBOOL_H_ +#define _SYS_STDBOOL_H_ +#ifndef __bool_true_false_are_defined #ifndef __cplusplus #define bool _Bool @@ -41,5 +42,6 @@ #endif /* __cplusplus */ #define __bool_true_false_are_defined 1 +#endif -#endif /* _STDBOOL_H_ */ +#endif /* _SYS_STDBOOL_H_ */ diff --git a/sys/sys/types.h b/sys/sys/types.h index 681f43937c51..9233d3c56867 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -1,4 +1,4 @@ -/* $NetBSD: types.h,v 1.91 2013/12/12 17:53:03 matt Exp $ */ +/* $NetBSD: types.h,v 1.92 2015/07/29 00:10:25 christos Exp $ */ /*- * Copyright (c) 1982, 1986, 1991, 1993, 1994 @@ -204,11 +204,14 @@ typedef int psetid_t; * Boolean type definitions for the kernel environment. User-space * boolean definitions are found in . */ +#ifndef __bool_true_false_are_defined #ifndef __cplusplus #define bool _Bool #define true 1 #define false 0 #endif +#define __bool_true_false_are_defined 1 +#endif /* * Deprecated Mach-style boolean_t type. Should not be used by new code.