Deal with backported bool type for RHEL5's 2.6.18 kernel
authorIan Abbott <abbotti@mev.co.uk>
Mon, 5 Sep 2011 12:17:20 +0000 (13:17 +0100)
committerIan Abbott <abbotti@mev.co.uk>
Mon, 5 Sep 2011 12:17:20 +0000 (13:17 +0100)
commit63cb02bd3cd217700d094c1f1c4611295e45b9c5
treead77fec85648eead440b47a966e4c824967b5084
parentcc428f9abc08d3c9f14154abbe5d5ba9bce499ca
Deal with backported bool type for RHEL5's 2.6.18 kernel

RHEL5's 2.6.18 kernel includes a change backported from 2.6.19 that
declares a generic 'bool' type in <linux/types.h> and declares the
'false' and 'true' enum values in <linux/stddef.h>.  Comedi's
compatibility header for <linux/stddef.h> declared the 'false' and
'true' enum values for any kernel version below 2.6.19.  This resulted
in comedi failing to build due to redeclaration errors.

Add an autoconf test to see if the generic 'bool' type is defined in
<linux/types.h> and if so define the macro
CONFIG_COMEDI_HAVE_GENERIC_BOOL_TYPE in <config.h>.  Conditionally
declare the 'bool' type in the <linux/types.h> compatibility header and
change the condition for declaring the 'false' and 'true' enum values in
the <linux/stddef.h> compatibility header so they are only declared if
the CONFIG_COMEDI_HAVE_GENERIC_BOOL_TYPE macro is undefined.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
configure.ac
include/linux/stddef.h
include/linux/types.h
m4/as-linux.m4