Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src move stdbool.h to sys, reuire pool.h to include <sys/stdbool...



details:   https://anonhg.NetBSD.org/src/rev/e1e6c579ab74
branches:  trunk
changeset: 809713:e1e6c579ab74
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jul 29 00:10:25 2015 +0000

description:
move stdbool.h to sys, reuire pool.h to include <sys/stdbool.h> for bool,
centralize definitions of bool, true, false, to <sys/stdbool.h>

diffstat:

 include/Makefile  |   4 ++--
 include/stdbool.h |  45 ---------------------------------------------
 sys/sys/Makefile  |   7 ++++---
 sys/sys/pool.h    |   4 +++-
 sys/sys/stdbool.h |  47 +++++++++++++++++++++++++++++++++++++++++++++++
 sys/sys/types.h   |   5 ++++-
 6 files changed, 60 insertions(+), 52 deletions(-)

diffs (188 lines):

diff -r 37b87b3dab0c -r e1e6c579ab74 include/Makefile
--- a/include/Makefile  Tue Jul 28 21:24:43 2015 +0000
+++ b/include/Makefile  Wed Jul 29 00:10:25 2015 +0000
@@ -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 @@
        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 -r 37b87b3dab0c -r e1e6c579ab74 include/stdbool.h
--- a/include/stdbool.h Tue Jul 28 21:24:43 2015 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*     $NetBSD: stdbool.h,v 1.5 2013/04/26 17:41:34 joerg Exp $        */
-
-/*-
- * Copyright (c) 2002 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe of Wasabi Systems, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, 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.
- */
-
-#ifndef _STDBOOL_H_
-#define        _STDBOOL_H_
-
-#ifndef __cplusplus
-#define        bool    _Bool
-
-#define        true    1
-#define        false   0
-
-#endif /* __cplusplus */
-
-#define        __bool_true_false_are_defined   1
-
-#endif /* _STDBOOL_H_ */
diff -r 37b87b3dab0c -r e1e6c579ab74 sys/sys/Makefile
--- a/sys/sys/Makefile  Tue Jul 28 21:24:43 2015 +0000
+++ b/sys/sys/Makefile  Wed Jul 29 00:10:25 2015 +0000
@@ -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 <bsd.own.mk>
 
@@ -37,8 +37,8 @@
        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 @@
        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 -r 37b87b3dab0c -r e1e6c579ab74 sys/sys/pool.h
--- a/sys/sys/pool.h    Tue Jul 28 21:24:43 2015 +0000
+++ b/sys/sys/pool.h    Wed Jul 29 00:10:25 2015 +0000
@@ -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 <sys/stdbool.h>
 #include <sys/stdint.h>
 
 struct pool_sysctl {
diff -r 37b87b3dab0c -r e1e6c579ab74 sys/sys/stdbool.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/sys/stdbool.h Wed Jul 29 00:10:25 2015 +0000
@@ -0,0 +1,47 @@
+/*     $NetBSD: stdbool.h,v 1.1 2015/07/29 00:10:25 christos Exp $     */
+
+/*-
+ * Copyright (c) 2002 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of Wasabi Systems, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, 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.
+ */
+
+#ifndef _SYS_STDBOOL_H_
+#define        _SYS_STDBOOL_H_
+
+#ifndef __bool_true_false_are_defined
+#ifndef __cplusplus
+#define        bool    _Bool
+
+#define        true    1
+#define        false   0
+
+#endif /* __cplusplus */
+
+#define        __bool_true_false_are_defined   1
+#endif
+
+#endif /* _SYS_STDBOOL_H_ */
diff -r 37b87b3dab0c -r e1e6c579ab74 sys/sys/types.h
--- a/sys/sys/types.h   Tue Jul 28 21:24:43 2015 +0000
+++ b/sys/sys/types.h   Wed Jul 29 00:10:25 2015 +0000
@@ -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 @@
  * Boolean type definitions for the kernel environment.  User-space
  * boolean definitions are found in <stdbool.h>.
  */
+#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.



Home | Main Index | Thread Index | Old Index