projects
/
m6w6
/
ext-psi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
travis: libsegfault
[m6w6/ext-psi]
/
m4
/
psi
/
psi_const.m4
diff --git
a/m4/psi/psi_const.m4
b/m4/psi/psi_const.m4
index f0345adfbff8af68c44dfa85968d42121a46a0ed..98aeed4054f0612a38fa29bfd1ab94e8b12e40a2 100644
(file)
--- a/
m4/psi/psi_const.m4
+++ b/
m4/psi/psi_const.m4
@@
-1,51
+1,29
@@
# psi_add_str_const(name, value)
# psi_add_str_const(name, value)
-# Add a pre-defined string constant to $PSI_CONSTS
+# Add a pre-defined string constant to $PSI_CONSTS
_H
psi_add_str_const() {
psi_add_str_const() {
- grep -Fq "\"psi\\\\$1\"" $PSI_CONSTS \
- || cat >>$PSI_CONSTS <<EOF
- {PSI_T_STRING, "string", "psi\\\\$1", $2, PSI_T_QUOTED_STRING},
-EOF
+ PSI_CONSTS="$PSI_CONSTS
+ {PSI_T_STRING, \"string\", \"psi\\\\$1\", {.ptr = $1}},"
}
# psi_add_int_const(name, value)
}
# psi_add_int_const(name, value)
-# Add a pre-defined int constant to $PSI_CONSTS
+# Add a pre-defined int constant to $PSI_CONSTS
_H
psi_add_int_const() {
psi_add_int_const() {
- grep -Fq "\"psi\\\\$1\"" $PSI_CONSTS \
- || cat >>$PSI_CONSTS <<EOF
- {PSI_T_INT, "int", "psi\\\\$1", "$2", PSI_T_NUMBER},
-EOF
+ PSI_CONSTS="$PSI_CONSTS
+ {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, [
}
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*)
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)
;;
int)
- AC_COMPUTE_INT(psi_const_val, $1, PSI_INCLUDES)
+ psi_add_int_const "$1"
;;
esac
;;
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
+ ],, PSI_INCLUDES)
])
])