57edff4a39032d0ec5c08dbcfa5b0a114f675d7f
[m6w6/ext-psi] / m4 / psi / psi_const.m4
1 # psi_add_str_const(name, value)
2 # Add a pre-defined string constant to $PSI_CONSTS_H
3 psi_add_str_const() {
4 PSI_CONSTS="$PSI_CONSTS
5 {PSI_T_STRING, \"string\", \"psi\\\\$1\", {.ptr = $1}},"
6 }
7
8 # psi_add_int_const(name, value)
9 # Add a pre-defined int constant to $PSI_CONSTS_H
10 psi_add_int_const() {
11 PSI_CONSTS="$PSI_CONSTS
12 {PSI_T_INT, \"int\", \"psi\\\\$1\", {.zend.lval = (zend_long) $1}},"
13 }
14
15 dnl PSI_CONST(const name, type)
16 dnl Check the value of a str/int constant and add it to the list of pre-defined
17 dnl constants.
18 AC_DEFUN(PSI_CONST, [
19 AC_CHECK_DECL($1, [
20 if test "$psi_cv_const_$1"
21 then
22 case $2 in
23 str*)
24 psi_add_str_const "$1"
25 ;;
26 int)
27 psi_add_int_const "$1"
28 ;;
29 esac
30 fi
31 ],, [PSI_INCLUDES])
32 ])