SWIG doesn't like adding TSRMLS_* macros to fn decls, so TSRMLS_FETCH it is
This commit is contained in:
parent
c67391cfbb
commit
d6dbf4ba41
1 changed files with 5 additions and 7 deletions
|
|
@ -146,7 +146,7 @@
|
||||||
for (int i=0; i < token->token_data.seq->used; i++) {
|
for (int i=0; i < token->token_data.seq->used; i++) {
|
||||||
zval *tmp;
|
zval *tmp;
|
||||||
ALLOC_INIT_ZVAL(tmp);
|
ALLOC_INIT_ZVAL(tmp);
|
||||||
hpt_to_php(token->token_data.seq->elements[i], tmp TSRMLS_CC);
|
hpt_to_php(token->token_data.seq->elements[i], tmp);
|
||||||
add_next_index_zval(return_value, tmp);
|
add_next_index_zval(return_value, tmp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -176,11 +176,10 @@
|
||||||
MAKE_STD_ZVAL(args[0]);
|
MAKE_STD_ZVAL(args[0]);
|
||||||
ALLOC_INIT_ZVAL(ret);
|
ALLOC_INIT_ZVAL(ret);
|
||||||
ZVAL_STRING(&func, (const char*)user_data, 0);
|
ZVAL_STRING(&func, (const char*)user_data, 0);
|
||||||
hpt_to_php(p->ast, args[0] TSRMLS_CC);
|
hpt_to_php(p->ast, args[0]);
|
||||||
int ok = call_user_function(EG(function_table), NULL, &func, ret, 1, args TSRMLS_CC);
|
int ok = call_user_function(EG(function_table), NULL, &func, ret, 1, args TSRMLS_CC);
|
||||||
if (ok != SUCCESS) {
|
if (ok != SUCCESS) {
|
||||||
printf("call_user_function failed\n");
|
zend_throw_exception(zend_exception_get_default(TSRMLS_C), "call_action failed", 0 TSRMLS_CC);
|
||||||
// FIXME throw some error
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
// Whatever the zval is, stuff it into a token
|
// Whatever the zval is, stuff it into a token
|
||||||
|
|
@ -197,11 +196,10 @@
|
||||||
MAKE_STD_ZVAL(args[0]);
|
MAKE_STD_ZVAL(args[0]);
|
||||||
ALLOC_INIT_ZVAL(ret);
|
ALLOC_INIT_ZVAL(ret);
|
||||||
ZVAL_STRING(&func, (const char*)user_data, 0);
|
ZVAL_STRING(&func, (const char*)user_data, 0);
|
||||||
hpt_to_php(p->ast, args[0] TSRMLS_CC);
|
hpt_to_php(p->ast, args[0]);
|
||||||
int ok = call_user_function(EG(function_table), NULL, &func, ret, 1, args TSRMLS_CC);
|
int ok = call_user_function(EG(function_table), NULL, &func, ret, 1, args TSRMLS_CC);
|
||||||
if (ok != SUCCESS) {
|
if (ok != SUCCESS) {
|
||||||
printf("call_user_function failed\n");
|
zend_throw_exception(zend_exception_get_default(TSRMLS_C), "call_predicate failed", 0 TSRMLS_CC);
|
||||||
// FIXME throw some error
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return Z_LVAL_P(ret);
|
return Z_LVAL_P(ret);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue