AC_DEFINE([CONFIG_COMEDI_HAVE_CS_H],[true],[Define if Linux kernel source has pcmcia/cs.h (removed in 2.6.37)])
fi
+COMEDI_CHECK_HAVE_GENERIC_BOOL_TYPE([$LINUX_SRC_DIR],
+ [HAVE_GENERIC_BOOL_TYPE="yes"], [HAVE_GENERIC_BOOL_TYPE="no"])
+if test "$HAVE_GENERIC_BOOL_TYPE" = "yes" ; then
+ AC_DEFINE([CONFIG_COMEDI_HAVE_GENERIC_BOOL_TYPE],[true],[Define if Linux kernel source has generic 'bool' type in linux/types.h])
+fi
+
AS_CHECK_LINUX_CONFIG_OPTION([CONFIG_USB],[HAVE_USB="yes"],[HAVE_USB="yes"],[HAVE_USB="no"])
AM_CONDITIONAL([CONFIG_USB],[test "$HAVE_USB" = "yes"])
AC_ARG_ENABLE([usb],[ --disable-usb Disable support for USB devices],
#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
+#ifndef CONFIG_COMEDI_HAVE_GENERIC_BOOL_TYPE
typedef enum {
false,
true
/* resource_size_t is either u32 or u64, depending on CONFIG_RESOURCES_64BIT */
#endif
+#ifndef CONFIG_COMEDI_HAVE_GENERIC_BOOL_TYPE
+typedef _Bool bool;
+#endif
+
#include_next <linux/types.h>
#endif
$3
fi
])
+
+# COMEDI_CHECK_HAVE_GENERIC_BOOL_TYPE([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# -------------------------------------------------------------
+# Check if kernel is new enough to have generic 'bool' type in <linux/types.h>
+# and 'false' and 'true' enum constants in <linux/stddef.h>. This was added
+# in vanilla 2.6.19, but backported to RHEL5 2.6.18.
+AC_DEFUN([COMEDI_CHECK_HAVE_GENERIC_BOOL_TYPE],
+[
+ AC_MSG_CHECKING([$1 for 'bool' in include/linux/types.h])
+ if grep -q 'bool;' "$1/include/linux/types.h" 2>/dev/null; then
+ AC_MSG_RESULT([yes])
+ $2
+ else
+ AC_MSG_RESULT([no])
+ $3
+ fi
+])