autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in AC_CHECK_MEMBER


From: Paul Eggert
Subject: Re: Bug in AC_CHECK_MEMBER
Date: Fri, 17 May 2002 17:59:30 -0700 (PDT)

> Organization: Farlep-Internet
> From: Sergey Poznyakoff <address@hidden>
> Date: Tue, 14 May 2002 17:23:44 +0300
> 
> AC_CHECK_MEMBER fails when the member whose presence is checked is
> itself an aggregate type.

Thanks for the bug report.  I checked in the following patch.

2002-05-17  Paul Eggert  <address@hidden>

        * lib/autoconf/types.m4 (AC_CHECK_MEMBER): Work correctly even if
        the member is itself an aggregate.  Bug reported by Sergey Poznyakoff.
        This improves on an earlier suggestion by H. Peter Anvin.

Index: NEWS
===================================================================
RCS file: /cvsroot/autoconf/autoconf/NEWS,v
retrieving revision 1.239
diff -p -u -r1.239 NEWS
--- NEWS        17 May 2002 07:13:59 -0000      1.239
+++ NEWS        18 May 2002 00:56:12 -0000
@@ -28,6 +28,8 @@
 
 - Empty top_builddirs are properly handled.
 
+- AC_CHECK_MEMBER works correctly when the member is an aggregate.
+
 - AC_PATH_PROG
   Now colon in the optional path arguments are properly handled.
 
Index: lib/autoconf/types.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/types.m4,v
retrieving revision 1.15
diff -p -u -r1.15 types.m4
--- lib/autoconf/types.m4       5 Feb 2002 22:56:17 -0000       1.15
+++ lib/autoconf/types.m4       18 May 2002 00:56:18 -0000
@@ -434,7 +434,14 @@ dnl ac_aggr.MEMBER;
 if (ac_aggr.m4_bpatsubst([$1], [^[^.]*\.]))
 return 0;])],
                 [AS_VAR_SET(ac_Member, yes)],
-                [AS_VAR_SET(ac_Member, no)])])
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])],
+[dnl AGGREGATE ac_aggr;
+static m4_bpatsubst([$1], [\..*]) ac_aggr;
+dnl sizeof ac_aggr.MEMBER;
+if (sizeof ac_aggr.m4_bpatsubst([$1], [^[^.]*\.]))
+return 0;])],
+                [AS_VAR_SET(ac_Member, yes)],
+                [AS_VAR_SET(ac_Member, no)])])])
 AS_IF([test AS_VAR_GET(ac_Member) = yes], [$2], [$3])dnl
 AS_VAR_POPDEF([ac_Member])dnl
 ])# AC_CHECK_MEMBER



reply via email to

[Prev in Thread] Current Thread [Next in Thread]