Only use gcc -Wunused-but-set-variable when available
[zfs.git] / config / kernel-create-nameidata.m4
1 dnl #
2 dnl # 3.6 API change
3 dnl #
4 AC_DEFUN([ZFS_AC_KERNEL_CREATE_NAMEIDATA], [
5         AC_MSG_CHECKING([whether iops->create() takes struct nameidata])
6         ZFS_LINUX_TRY_COMPILE([
7                 #include <linux/fs.h>
8         ],[
9                 #ifdef HAVE_MKDIR_UMODE_T
10                 int (*inode_create) (struct inode *,struct dentry *,
11                                      umode_t, struct nameidata *) = NULL;
12                 #else
13                 int (*inode_create) (struct inode *,struct dentry *,
14                                      int, struct nameidata *) = NULL;
15                 #endif
16                 struct inode_operations iops __attribute__ ((unused)) = {
17                         .create         = inode_create,
18                 };
19         ],[
20                 AC_MSG_RESULT(yes)
21                 AC_DEFINE(HAVE_CREATE_NAMEIDATA, 1,
22                           [iops->create() operation takes nameidata])
23         ],[
24                 AC_MSG_RESULT(no)
25         ])
26 ])