forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux 6.7 compat: detect if kernel defines intptr_t
Since Linux 6.7 the kernel has defined intptr_t. Clang has -Wtypedef-redefinition by default, which causes the build to fail because we also have a typedef for intptr_t. Since its better to use the kernel's if it exists, detect it and skip our own. Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes openzfs#16201
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
dnl # | ||
dnl # check if kernel provides definitions for given types | ||
dnl # | ||
|
||
dnl _ZFS_AC_KERNEL_SRC_TYPE(type) | ||
AC_DEFUN([_ZFS_AC_KERNEL_SRC_TYPE], [ | ||
ZFS_LINUX_TEST_SRC([type_$1], [ | ||
#include <linux/types.h> | ||
],[ | ||
const $1 __attribute__((unused)) x = ($1) 0; | ||
]) | ||
]) | ||
|
||
dnl _ZFS_AC_KERNEL_TYPE(type) | ||
AC_DEFUN([_ZFS_AC_KERNEL_TYPE], [ | ||
AC_MSG_CHECKING([whether kernel defines $1]) | ||
ZFS_LINUX_TEST_RESULT([type_$1], [ | ||
AC_MSG_RESULT([yes]) | ||
AC_DEFINE([HAVE_KERNEL_]m4_quote(m4_translit([$1], [a-z], [A-Z])), | ||
1, [kernel defines $1]) | ||
], [ | ||
AC_MSG_RESULT([no]) | ||
]) | ||
]) | ||
|
||
dnl ZFS_AC_KERNEL_TYPES([types...]) | ||
AC_DEFUN([ZFS_AC_KERNEL_TYPES], [ | ||
AC_DEFUN([ZFS_AC_KERNEL_SRC_TYPES], [ | ||
m4_foreach_w([type], [$1], [ | ||
_ZFS_AC_KERNEL_SRC_TYPE(type) | ||
]) | ||
]) | ||
AC_DEFUN([ZFS_AC_KERNEL_TYPES], [ | ||
m4_foreach_w([type], [$1], [ | ||
_ZFS_AC_KERNEL_TYPE(type) | ||
]) | ||
]) | ||
]) | ||
|
||
ZFS_AC_KERNEL_TYPES([intptr_t]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters