From baf7656f666e0d47047c545561345e7803b8a141 Mon Sep 17 00:00:00 2001 From: Christof Hanke Date: Wed, 25 May 2011 22:16:59 +0200 Subject: [PATCH] autoconf: add test for typedef'd structs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AC_CHECK_LINUX_STRUCT does not work for structs which are typedef'd. The gcc will complain with "error: storage size of ‘_test’ isn’t known" and fail the test. Thus the new test-macro AC_CHECK_LINUX_TYPED_STRUCT. Change-Id: Ib3e933c4e09a3e950ca8d8e7a66909d86f10cfdf Reviewed-on: http://gerrit.openafs.org/4718 Reviewed-by: Christof Hanke Tested-by: BuildBot Reviewed-by: Marc Dionne Reviewed-by: Derrick Brashear --- src/cf/linux-test1.m4 | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/cf/linux-test1.m4 b/src/cf/linux-test1.m4 index 6c096a4fa4..106c5b59a1 100644 --- a/src/cf/linux-test1.m4 +++ b/src/cf/linux-test1.m4 @@ -127,11 +127,16 @@ AC_DEFUN([AC_CHECK_LINUX_FUNC], dnl AC_CHECK_LINUX_STRUCT([structure], [element], [includes]) AC_DEFUN([AC_CHECK_LINUX_STRUCT], - [AC_CHECK_LINUX_BUILD([for $2 in struct $1], - [ac_cv_linux_struct_$1_has_$2], - [#include ], - [struct $1 _test; printk("%x\n", &_test.$2); ], - AS_TR_CPP(STRUCT_$1_HAS_$2), - [Define if kernel struct $1 has the $2 element]) + [AC_CHECK_LINUX_TYPED_STRUCT([struct $1], [$2], [$3]) + ]) + +dnl AC_CHECK_LINUX_TYPED_STRUCT([structure], [element], [includes]) +AC_DEFUN([AC_CHECK_LINUX_TYPED_STRUCT], + [AC_CHECK_LINUX_BUILD([for $2 in $1], + [ac_cv_linux_$1_has_$2], + [#include ], + [$1 _test; printk("%x\n", &_test.$2); ], + AS_TR_CPP($1_HAS_$2), + [Define if kernel typedef'd $1 has the $2 element]) ])