e3555838b69e9ac0901cd5327148f9369f6a8762
[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 case $2 in
21 str*)
22 psi_add_str_const "$1"
23 ;;
24 int)
25 psi_add_int_const "$1"
26 ;;
27 esac
28 ])
29 ])