Adding bool, true, and false to the kernel

From: Matthew Fleming <mdf356_at_gmail.com>
Date: Thu, 8 Dec 2011 16:36:58 -0800
Hello -current!

Recently on -arch_at_, we discussed adding the C99 keywords bool, true,
and false to the kernel.  I now have patches to do this as well as fix
up some build issues.

The original thread was here:

http://lists.freebsd.org/pipermail/freebsd-arch/2011-November/011937.html

I split the patches in three:

http://people.freebsd.org/~mdf/0001-e1000-ixgbe-fix-code-to-not-define-bool-true-false-w.patch

fixes up the e1000 and ixgbe code.  Jack, can you please let me know
if there are any issues.  This should work to build whether or not
sys/types.h has the new defines; I am testing make universe right now.

http://people.freebsd.org/~mdf/0002-Fix-code-to-not-define-bool-true-false-when-already-.patch

fixes the other code in the sys/ directory that gives build conflicts.
 Since I wasn't sure of the origin of the drivers, I conservatively
left all their defines alone to allow the same driver code to build on
both CURRENT and 9.0.  If some of the drivers are wholly-owned by
FreeBSD (unlike e1000 and ixgbe) and are not expected to be built on
older releases, then the use of the old defines can be removed.  If
anyone knows the provenance of these files, please advise.

http://people.freebsd.org/~mdf/0003-Define-bool-true-and-false-in-types.h-for-_KERNEL-co.patch

actually defines bool, true, and false, and adds some extra paranoia
in <stdbool.h> for anyone who has hacked their local build system and
project repo to include <stdbool.h> in a kernel file.  I also bumped
__FreeBSD_version, though this is probably not necessary since
__bool_true_false_are_defined is a better check than the
__FreeBSD_version.

This code should be MFC-able to stable/9 after 9.0 is released.

Thanks,
matthew
Received on Thu Dec 08 2011 - 23:37:00 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:21 UTC