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.
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'.
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
[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