Hello, On Thu, Sep 01, 2005 at 04:43:30AM -0500, Albert Chin wrote: > for arg2 in "struct sockaddr" void; do > for t in int size_t unsigned long "unsigned long"; do > AC_TRY_COMPILE([ > #include <sys/types.h> > #include <sys/socket.h> > > int getpeername (int, $arg2 *, $t *); > ],[ > $t len; > getpeername(0,0,&len); > ],[ > socklen_t_equiv="$t" > break > ]) > done > done
I see two problems with this code: 1) Wouldn't "break 2" be more appropriate? 2) The use of `break' or `continue' inside `AC_*_IFELSE' (or the obsolete AC_TRY_*) is not safe; it skips the cleanup of that macro. Something like this is better: ... ],[ socklen_t_equiv="$t" ]) done test -z "$socklen_t_equiv" && break done if -z "$socklen_t_equiv"; then AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) fi Have a nice day, Stepan Kasal _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib