From: Ralf Wildenhues Date: Sat, 11 Mar 2006 13:21:32 +0000 (+0000) Subject: * lib/autoconf/c.m4 (AC_C_TYPEOF): Use typedef to avoid defining X-Git-Tag: AUTOCONF-2.59c~148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8ad4b48ac856e629c1ccaaa6ad8a8b3cb299a85;p=thirdparty%2Fautoconf.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 6be4daadb..0e1798925 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2006-03-11 Ralf Wildenhues + * 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'. diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index a3707f73e..fc2561dcb 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -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 diff --git a/lib/autoconf/types.m4 b/lib/autoconf/types.m4 index c950c58ab..fd0124785 100644 --- a/lib/autoconf/types.m4 +++ b/lib/autoconf/types.m4 @@ -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