Daniel Shahaf wrote on Mon, Jul 29, 2013 at 20:41:20 +0300:
> +AC_DEFUN([SVN_CHECK_FOR_DUNDER_BUILTINS],
> +[
> + AC_CACHE_CHECK([whether the compiler provides dunder builtins],
> [svn_cv_dunder_builtins],
> + [
> + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
> + int main(int argc)
> + {
> + return (!__builtin_choose_expr(__builtin_constant_p(argc), 1, 0)
> + && __builtin_choose_expr(__builtin_constant_p("foobar"), 1,
> 0))
> + ? 0 /* EXIT_SUCCESS */ : 1 /* EXIT_FAILURE */;
> + }]])], svn_cv_dunder_builtins="yes", svn_cv_dunder_builtins="no")
Actually, the way I wrote this is designed for AC_RUN_IFELSE, not
AC_COMPILE_IFELSE. So I'll probably adjust this to use AC_RUN_IFELSE
(and fall back to AC_COMPILE_IFELSE for the cross-compile case).
> + ])
> +])