PSI_CHECK_LIBJIT
PSI_CHECK_LIBFFI
- AC_PATH_PROG(NM, nm)
AC_FUNC_FNMATCH
AC_FUNC_MMAP
AC_DEFUN([AX_CHECK_SIGN], [
typename=`echo $1 | sed "s/@<:@^a-zA-Z0-9_@:>@/_/g"`
AC_CACHE_CHECK([whether $1 is signed], ax_cv_decl_${typename}_signed, [
- AC_TRY_COMPILE([$4],
+ AC_TRY_COMPILE($4,
[ int foo @<:@ 1 - 2 * !((($1) -1) < 0) @:>@ ],
[ eval "ax_cv_decl_${typename}_signed=\"yes\"" ],
[ eval "ax_cv_decl_${typename}_signed=\"no\"" ])])
psi_save_LIBS=$LIBS
LIBS=
+ AC_PROG_AWK
+ AC_PATH_PROG(NM, nm)
+ AC_CACHE_CHECK(for libc start main symbol, psi_cv_libc_main, [
+ psi_libc_main=
+ AC_TRY_LINK(PSI_INCLUDES, [(void)0;], [
+ psi_libc_main=`nm -g conftest$ac_exeext | $AWK -F ' *|@' '/^@<:@@<:@:space:@:>@@:>@+U / {print$[]3; exit}'`
+ ])
+ psi_cv_libc_main=$psi_libc_main
+ ])
+
if test "$PHP_PSI_MAINTAINER_MODE" = "yes"; then
PSI_FAST_CONFIG=true
PSI_DEPS=true
PHP_SUBST(PSI_DEPS)
PSI_CONFIG_TMP=$(mktemp -d)
- PSI_FUNC_LIBC_MAIN
else
PSI_FAST_CONFIG=false
PSI_DEPS=false
psi_add_redir $1 ifelse([$2],[],[$1],[$2])
])
-dnl PSI_FUNC_LIBC_MAIN()
-dnl Check for the platforms default stub in executables.
-AC_DEFUN(PSI_FUNC_LIBC_MAIN, [
- AC_REQUIRE([AC_PROG_AWK])
- AC_CACHE_CHECK(for libc start main symbol, psi_cv_libc_main, [
- psi_libc_main=
- AC_TRY_LINK(PSI_INCLUDES, [(void)0;], [
- psi_libc_main=`nm -g conftest$ac_exeext | $AWK -F ' *|@' '/^@<:@@<:@:space:@:>@@:>@+U / {print$[]3; exit}'`
- ])
- psi_cv_libc_main=$psi_libc_main
- ])
-])
-
dnl PSI_DECL_ARGS(decl func, decl args, options)
dnl INTERNAL: build psi_decl_args
AC_DEFUN(PSI_DECL_ARGS, [
dnl Adds a pre-defined (vararg) decl to $PSI_VA_DECLS_H/$PSI_DECLS_H.
dnl Calls PSI_MACRO if PSI_FUNC fails.
AC_DEFUN(PSI_DECL, [
- AC_REQUIRE([PSI_FUNC_LIBC_MAIN])dnl
-
PSI_DECL_ARGS($1, $2, $3)
psi_symbol="PSI_VAR_NAME($1)"
psi_basic_type=AS_TR_SH($2)
case $psi_basic_type in
int)
- AX_CHECK_SIGN($1, :, [psi_basic_type=uint], PSI_INCLUDES)
+ AX_CHECK_SIGN($1, :, [psi_basic_type=uint], [PSI_INCLUDES])
;;
sint)
psi_basic_type=int
[double],[psi_add_stdtype "{PSI_T_DOUBLE, \"double\", NULL}"],
[long double],[psi_add_stdtype "{PSI_T_LONG_DOUBLE, \"long double\", NULL}"],
[
- AX_CHECK_SIGN($1, psi_basic_type=int, psi_basic_type=uint, PSI_INCLUDES)
+ AX_CHECK_SIGN($1, psi_basic_type=int, psi_basic_type=uint, [PSI_INCLUDES])
AS_TR_SH(psi_basic_type_$1)=$psi_basic_type
psi_add_stdtype "{`psi_type_pair $psi_basic_type PSI_SH_SIZEOF($1)`, \"$1\"}"
])
])
case "$AS_TR_SH([psi_cv_type_class_]$1)" in
scalar)
- AX_CHECK_SIGN($1, [psi_basic_type=int], [psi_basic_type=uint], PSI_INCLUDES)
+ AX_CHECK_SIGN($1, [psi_basic_type=int], [psi_basic_type=uint], [PSI_INCLUDES])
psi_add_type "{`psi_type_pair $psi_basic_type PSI_SH_SIZEOF($1)`, \"$1\"}"
;;
struct)
AC_CHECK_ALIGNOF(long double)
PSI_STDTYPE(bool)
- AC_CHECK_ALIGNOF(bool, PSI_INCLUDES)
+ AC_CHECK_ALIGNOF(bool, [PSI_INCLUDES])
PSI_STDTYPE(char, int)
AC_CHECK_ALIGNOF(char)
aip = calloc(argc + 1 + !!impl->func->vararg, sizeof(*aip));
fi = (zend_internal_function_info *) &aip[0];
+#ifdef ZEND_TYPE_ENCODE
fi->type = ZEND_TYPE_ENCODE(psi_internal_type(impl->func->return_type), 1);
+#else
+ fi->allow_null = 1;
+ fi->type_hint = psi_internal_type(impl->func->return_type);
+#endif
fi->required_num_args = psi_impl_num_min_args(impl);
fi->return_reference = impl->func->return_reference;
zend_internal_arg_info *ai = &aip[argc];
ai->name = vararg->var->name;
+#ifdef ZEND_TYPE_ENCODE
ai->type = ZEND_TYPE_ENCODE(psi_internal_type(vararg->type), 1);
+#else
+ ai->allow_null = 1;
+ ai->type_hint = psi_internal_type(vararg->type);
+#endif
if (vararg->var->reference) {
ai->pass_by_reference = 1;
}
zend_internal_arg_info *ai = &aip[i];
ai->name = iarg->var->name;
+#ifdef ZEND_TYPE_ENCODE
ai->type = ZEND_TYPE_ENCODE(psi_internal_type(iarg->type), 1);
+#else
+ ai->allow_null = 1;
+ ai->type_hint = psi_internal_type(iarg->type);
+#endif
if (iarg->var->reference) {
ai->pass_by_reference = 1;
}