summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authormdf <mdf@FreeBSD.org>2011-12-12 18:44:17 +0000
committermdf <mdf@FreeBSD.org>2011-12-12 18:44:17 +0000
commit21f7c1b29fdf6a1f3ff0070ce7cb0baaf2786fe5 (patch)
treefbc23e88a4737d6047e518d9540133f1e568c6d6 /include
parent20fbb4d01304ebe013c75e1a2ac638689ce4e9ba (diff)
downloadFreeBSD-src-21f7c1b29fdf6a1f3ff0070ce7cb0baaf2786fe5.zip
FreeBSD-src-21f7c1b29fdf6a1f3ff0070ce7cb0baaf2786fe5.tar.gz
- Define true and false in sys/types.h for _KERNEL consumers, and
typedef bool. Due to macro expansion it seemed better to use a typedef for kernel consumers (specifically ofed won't compile without more changes if a define is used). - <stdbool.h> should also not re-define bool/true/false if they are defined by <sys/types.h>. It would probably be a programming error to define _KERNEL for user-space code, but downstream consumers like Isilon have already been including <stdbool.h> in kernel sources, and this protects that usage. - sizeof(_Bool) is not necessarily the same as sizeof(int), so kernel modules should be rebuild with this change. Bump __FreeBSD_version. MFC after: 2 weeks Sponsored by: Isilon Systems, LLC
Diffstat (limited to 'include')
-rw-r--r--include/stdbool.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/stdbool.h b/include/stdbool.h
index c0d6459..099549c 100644
--- a/include/stdbool.h
+++ b/include/stdbool.h
@@ -29,6 +29,7 @@
#ifndef _STDBOOL_H_
#define _STDBOOL_H_
+#ifndef __bool_true_false_are_defined
#define __bool_true_false_are_defined 1
#ifndef __cplusplus
@@ -42,5 +43,6 @@ typedef int _Bool;
#endif
#endif /* !__cplusplus */
+#endif /* __bool_true_false_are_defined */
#endif /* !_STDBOOL_H_ */
OpenPOWER on IntegriCloud