Verify parent_dev before calling udev_device_get_sysattr_value
[zfs.git] / config / kernel-types.m4
blobed76af28337be447cc25e63e2d5055982a8cb2f4
1 dnl #
2 dnl # check if kernel provides definitions for given types
3 dnl #
5 dnl _ZFS_AC_KERNEL_SRC_TYPE(type)
6 AC_DEFUN([_ZFS_AC_KERNEL_SRC_TYPE], [
7         ZFS_LINUX_TEST_SRC([type_$1], [
8                 #include <linux/types.h>
9         ],[
10                 const $1 __attribute__((unused)) x = ($1) 0;
11         ])
14 dnl _ZFS_AC_KERNEL_TYPE(type)
15 AC_DEFUN([_ZFS_AC_KERNEL_TYPE], [
16         AC_MSG_CHECKING([whether kernel defines $1])
17         ZFS_LINUX_TEST_RESULT([type_$1], [
18                 AC_MSG_RESULT([yes])
19                 AC_DEFINE([HAVE_KERNEL_]m4_quote(m4_translit([$1], [a-z], [A-Z])),
20                     1, [kernel defines $1])
21         ], [
22                 AC_MSG_RESULT([no])
23         ])
26 dnl ZFS_AC_KERNEL_TYPES([types...])
27 AC_DEFUN([ZFS_AC_KERNEL_TYPES], [
28         AC_DEFUN([ZFS_AC_KERNEL_SRC_TYPES], [
29                 m4_foreach_w([type], [$1], [
30                         _ZFS_AC_KERNEL_SRC_TYPE(type)
31                 ])
32         ])
33         AC_DEFUN([ZFS_AC_KERNEL_TYPES], [
34                 m4_foreach_w([type], [$1], [
35                         _ZFS_AC_KERNEL_TYPE(type)
36                 ])
37         ])
40 ZFS_AC_KERNEL_TYPES([intptr_t])