X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=m4%2Fpsi%2Fpsi_const.m4;h=e3555838b69e9ac0901cd5327148f9369f6a8762;hp=e0b67a36751726874e0b0f919755157e3592c891;hb=fb8f7887c289ae74d6e8dd85d55ae09e6796e890;hpb=894e0ce93f9ce82109e904ae35c249bf6abe54f1 diff --git a/m4/psi/psi_const.m4 b/m4/psi/psi_const.m4 index e0b67a3..e355583 100644 --- a/m4/psi/psi_const.m4 +++ b/m4/psi/psi_const.m4 @@ -2,47 +2,28 @@ # Add a pre-defined string constant to $PSI_CONSTS_H psi_add_str_const() { PSI_CONSTS="$PSI_CONSTS - {PSI_T_STRING, \"string\", \"psi\\\\$1\", $2, PSI_T_QUOTED_STRING}," + {PSI_T_STRING, \"string\", \"psi\\\\$1\", {.ptr = $1}}," } # psi_add_int_const(name, value) # Add a pre-defined int constant to $PSI_CONSTS_H psi_add_int_const() { PSI_CONSTS="$PSI_CONSTS - {PSI_T_INT, \"int\", \"psi\\\\$1\", \"$2\", PSI_T_NUMBER}, -" + {PSI_T_INT, \"int\", \"psi\\\\$1\", {.zend.lval = (zend_long) $1}}," } dnl PSI_CONST(const name, type) dnl Check the value of a str/int constant and add it to the list of pre-defined dnl constants. AC_DEFUN(PSI_CONST, [ - AC_CACHE_CHECK(value of $1, psi_cv_const_$1, [ - psi_const_val= + AC_CHECK_DECL($1, [ case $2 in str*) - if test "$cross_compiling" = "yes" - then - AC_TRY_CPP(PSI_INCLUDES $1, psi_const_val=`eval "$ac_try|tail -n1"`, psi_const_val=) - else - PSI_COMPUTE_STR(psi_const_val, $1, PSI_INCLUDES) - fi + psi_add_str_const "$1" ;; int) - AC_COMPUTE_INT(psi_const_val, $1, PSI_INCLUDES) + psi_add_int_const "$1" ;; esac - psi_cv_const_$1=$psi_const_val ]) - if test "$psi_cv_const_$1" - then - case $2 in - str*) - psi_add_str_const "$1" "$psi_cv_const_$1" - ;; - int) - psi_add_int_const "$1" "$psi_cv_const_$1" - ;; - esac - fi ])