From 4421b9c6e44736197aa710441ddf13e9eabcc354 Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Tue, 25 Oct 2016 10:26:37 +0200
Subject: [PATCH] Clean up <sys/stdbool.h>. The kernel has bool etc. in
 <sys/types.h> now.

Remove <sys/stdbool.h> basically.
---
 Makefile_upgrade.inc                 |  1 +
 include/stdbool.h                    | 21 +++++++++++++---
 sys/kern/sys_mqueue.c                |  1 -
 sys/libprop/prop_object.h            |  4 ++-
 sys/netproto/802_11/README.DRAGONFLY |  1 -
 sys/sys/stdbool.h                    | 48 ------------------------------------
 sys/vfs/autofs/autofs.h              |  1 -
 7 files changed, 22 insertions(+), 55 deletions(-)
 delete mode 100644 sys/sys/stdbool.h

diff --git a/Makefile_upgrade.inc b/Makefile_upgrade.inc
index 7d32f6f..54b90f2 100644
--- a/Makefile_upgrade.inc
+++ b/Makefile_upgrade.inc
@@ -3137,6 +3137,7 @@ TO_REMOVE+=/usr/lib/libprivate_panelw.so.60
 TO_REMOVE+=/usr/lib/profile/libprivate_panel.a
 TO_REMOVE+=/usr/lib/profile/libprivate_panelw.a
 TO_REMOVE+=/usr/include/compat
+TO_REMOVE+=/usr/include/sys/stdbool.h
 
 .if !defined(WANT_INSTALLER)
 TO_REMOVE+=/usr/sbin/dfuibe_installer
diff --git a/include/stdbool.h b/include/stdbool.h
index 39b315b..36018c0 100644
--- a/include/stdbool.h
+++ b/include/stdbool.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 François Tigeot <ftigeot@wolfpond.org>
+ * Copyright (c) 2000 Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -23,11 +23,26 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
+ * $FreeBSD: src/include/stdbool.h,v 1.4.2.2 2002/06/19 06:05:26 obrien Exp $
  */
 
 #ifndef _STDBOOL_H_
-#define	_STDBOOL_H_	
+#define	_STDBOOL_H_
 
-#include <sys/stdbool.h>
+#define	__bool_true_false_are_defined	1
+
+#ifndef __cplusplus
+
+#include <sys/cdefs.h>
+
+#define	false	0
+#define	true	1
+
+#define	bool	_Bool
+#if __STDC_VERSION__ < 199901L && !__GNUC_PREREQ__(3, 0)
+typedef	int	_Bool;
+#endif
+
+#endif /* !__cplusplus */
 
 #endif /* !_STDBOOL_H_ */
diff --git a/sys/kern/sys_mqueue.c b/sys/kern/sys_mqueue.c
index c4de7dc..54d18fc 100644
--- a/sys/kern/sys_mqueue.c
+++ b/sys/kern/sys_mqueue.c
@@ -61,7 +61,6 @@
 #include <sys/spinlock.h>
 #include <sys/spinlock2.h>
 #include <sys/stat.h>
-#include <sys/stdbool.h>
 #include <sys/sysctl.h>
 #include <sys/sysproto.h>
 #include <sys/systm.h>
diff --git a/sys/libprop/prop_object.h b/sys/libprop/prop_object.h
index a11da82..e7e3682 100644
--- a/sys/libprop/prop_object.h
+++ b/sys/libprop/prop_object.h
@@ -34,7 +34,9 @@
 
 #include <sys/types.h>
 
-#include <sys/stdbool.h>
+#ifndef _KERNEL
+#include <stdbool.h>
+#endif
 
 typedef void *prop_object_t;
 
diff --git a/sys/netproto/802_11/README.DRAGONFLY b/sys/netproto/802_11/README.DRAGONFLY
index 439f6f6..28792f3 100644
--- a/sys/netproto/802_11/README.DRAGONFLY
+++ b/sys/netproto/802_11/README.DRAGONFLY
@@ -11,7 +11,6 @@
 
       remove <machine/bus.h>
       remove <machine/resource.h>
-      add    <sys/stdbool.h>
       add    <net/ifq_var.h>
 
     * Simple API changes
diff --git a/sys/sys/stdbool.h b/sys/sys/stdbool.h
deleted file mode 100644
index 16d7223..0000000
--- a/sys/sys/stdbool.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2000 Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org>
- * All rights reserved.
- *
- * 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 AUTHOR 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 AUTHOR 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.
- *
- * $FreeBSD: src/include/stdbool.h,v 1.4.2.2 2002/06/19 06:05:26 obrien Exp $
- */
-
-#ifndef _SYS_STDBOOL_H_
-#define	_SYS_STDBOOL_H_
-
-#define	__bool_true_false_are_defined	1
-
-#ifndef __cplusplus
-
-#include <sys/cdefs.h>
-
-#define	false	0
-#define	true	1
-
-#define	bool	_Bool
-#if __STDC_VERSION__ < 199901L && !__GNUC_PREREQ__(3, 0)
-typedef	int	_Bool;
-#endif
-
-#endif /* !__cplusplus */
-
-#endif /* !_SYS_STDBOOL_H_ */
diff --git a/sys/vfs/autofs/autofs.h b/sys/vfs/autofs/autofs.h
index 8566ef9..0b9562b 100644
--- a/sys/vfs/autofs/autofs.h
+++ b/sys/vfs/autofs/autofs.h
@@ -37,7 +37,6 @@
 #include <sys/module.h>
 #include <sys/types.h>
 #include <sys/systm.h>
-#include <sys/stdbool.h>
 #include <sys/malloc.h>
 #include <sys/objcache.h>
 #include <sys/tree.h>
-- 
2.9.2

