]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/c.m4 (AC_C_TYPEOF): Use typedef to avoid defining
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 11 Mar 2006 13:21:32 +0000 (13:21 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 11 Mar 2006 13:21:32 +0000 (13:21 +0000)
a structure inside a cast, for C++ conformance.
* lib/autoconf/types.m4 (AC_CHECK_ALIGNOF): Likewise.
Also fix quoting error in `AC_MSG_FAILURE' arguments.

ChangeLog
lib/autoconf/c.m4
lib/autoconf/types.m4

index 6be4daadb23dc0d88665e054aeab45f3eb21fce1..0e1798925262adffaf6354fb33ad718426c97c01 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-03-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       * lib/autoconf/c.m4 (AC_C_TYPEOF): Use typedef to avoid defining
+       a structure inside a cast, for C++ conformance.
+       * lib/autoconf/types.m4 (AC_CHECK_ALIGNOF): Likewise.
+       Also fix quoting error in `AC_MSG_FAILURE' arguments.
+
        * lib/autoconf/c.m4 (AC_PROG_CC_STDC): If we cannot enable C99
        nor C89 mode, set `$ac_cv_prog_cc_stdc' to `no' instead of
        trying to execute the command `no'.
index a3707f73e0ccb3cc91edd1207135f38fd5e79565..fc2561dcb99a591ffee225ae51425611699b367d 100644 (file)
@@ -1448,17 +1448,16 @@ AC_DEFUN([AC_C_TYPEOF],
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
         [[
           int value;
-          return
-            (! ((void)
-                ((struct {
+          typedef struct {
                   char a [1
                           + ! (($ac_kw (value))
                                (($ac_kw (value)) 0 < ($ac_kw (value)) -1
                                 ? ($ac_kw (value)) - 1
                                 : ~ (~ ($ac_kw (value)) 0
-                                     << sizeof ($ac_kw (value)))))]; } *)
-                 0),
-                0));
+                                     << sizeof ($ac_kw (value)))))]; }
+             ac__typeof_type_;
+          return
+            (! ((void) ((ac__typeof_type_ *) 0), 0));
         ]])],
         [ac_cv_c_typeof=$ac_kw])
        test $ac_cv_c_typeof != no && break
index c950c58ab48668cae33c311981fe7ff5e5690b2e..fd01247852442009aaf24c1213232f8c7a2d0019 100644 (file)
@@ -408,13 +408,14 @@ AC_CACHE_CHECK([alignment of $1], AS_TR_SH([ac_cv_alignof_$1]),
 [if test "$AS_TR_SH([ac_cv_type_$1])" = yes; then
   # The cast to long int works around a bug in the HP C Compiler,
   # see AC_CHECK_SIZEOF for more information.
-  _AC_COMPUTE_INT([(long int) offsetof (struct { char x; $1 y; }, y)],
+  _AC_COMPUTE_INT([(long int) offsetof (ac__type_alignof_, y)],
                  [AS_TR_SH([ac_cv_alignof_$1])],
                  [AC_INCLUDES_DEFAULT([$2])
 #ifndef offsetof
 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
-#endif],
-                 [AC_MSG_FAILURE([cannot compute alignment of ($1), 77])])
+#endif
+typedef struct { char x; $1 y; } ac__type_alignof_;],
+                 [AC_MSG_FAILURE([cannot compute alignment of ($1)], 77)])
 else
   AS_TR_SH([ac_cv_alignof_$1])=0
 fi])dnl