SWIG doesn't like adding TSRMLS_* macros to fn decls, so TSRMLS_FETCH it is

This commit is contained in:
Meredith L. Patterson 2013-12-21 19:46:57 +01:00
parent c67391cfbb
commit d6dbf4ba41

View file

@ -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);