apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: apr_ssize_t and APR_SSIZE_T_FMT
Date Mon, 09 Jul 2007 21:54:12 GMT
On Mon, Jul 09, 2007 at 06:25:27PM -0300, Davi Arnaut wrote:
> +AC_DEFUN([APR_CHECK_TYPES_COMPATIBLE], [
> +AC_MSG_CHECKING(whether $1 and $2 are the same)
> +AC_TRY_COMPILE(AC_INCLUDES_DEFAULT, [
> +    __builtin_types_compatible_p($1, $2);
> +], [apr_types_compile=yes], [apr_types_compile=no])
> +AC_RUN_IFELSE([AC_LANG_SOURCE([AC_INCLUDES_DEFAULT

This should really cache properly; compiling as well as running is 
redundant too; something like this should do it:

AC_DEFUN([APR_CHECK_TYPES_COMPATIBLE], [
define([apr_cvname], apr_cv_typematch_[]translit([$1], [ ], [_])_[]translit([$2], [ ], [_]))
AC_CACHE_CHECK([whether blah], apr_cvname,
[AC_RUN_IFELSE(blah,
[apr_cvname=yes
$3], [apr_cvname=no])])])

which allows just:

APR_CHECK_TYPES_COMPATIBLE(ssize_t, long, [ssize_t_fmt="ld"])
etc


Mime
View raw message