Skip to content

Commit

Permalink
fix 5.5 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
krakjoe committed Sep 12, 2014
1 parent fc2078c commit 82df549
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 13 deletions.
9 changes: 6 additions & 3 deletions bits/function.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ PHP_METHOD(Func, getParent) {
pfunc = PHP_JIT_FETCH_FUNCTION(getThis());

if (Z_TYPE(pfunc->zparent) != IS_NULL) {
ZVAL_ZVAL(return_value, &pfunc->zparent, 1, 0);
ZVAL_COPY_VALUE(return_value, &pfunc->zparent);
zval_copy_ctor(return_value);
}
}

Expand All @@ -381,7 +382,8 @@ PHP_METHOD(Func, getContext) {
pfunc = PHP_JIT_FETCH_FUNCTION(getThis());

if (Z_TYPE(pfunc->zctx) != IS_NULL) {
ZVAL_ZVAL(return_value, &pfunc->zctx, 1, 0);
ZVAL_COPY_VALUE(return_value, &pfunc->zctx);
zval_copy_ctor(return_value);
}
}

Expand All @@ -395,7 +397,8 @@ PHP_METHOD(Func, getSignature) {
pfunc = PHP_JIT_FETCH_FUNCTION(getThis());

if (Z_TYPE(pfunc->zsig) != IS_NULL) {
ZVAL_ZVAL(return_value, &pfunc->zsig, 1, 0);
ZVAL_COPY_VALUE(return_value, &pfunc->zsig);
zval_copy_ctor(return_value);
}
}

Expand Down
8 changes: 5 additions & 3 deletions bits/signature.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ PHP_METHOD(Signature, getReturnType) {

psig = PHP_JIT_FETCH_SIGNATURE(getThis());

ZVAL_ZVAL(return_value, &psig->zreturns, 1, 0);
ZVAL_COPY_VALUE(return_value, &psig->zreturns);
zval_copy_ctor(return_value);
}

PHP_METHOD(Signature, getParamType) {
Expand All @@ -178,8 +179,9 @@ PHP_METHOD(Signature, getParamType) {
}

psig = PHP_JIT_FETCH_SIGNATURE(getThis());

ZVAL_ZVAL(return_value, &psig->zparams[param], 1, 0);

ZVAL_COPY_VALUE(return_value, &psig->zparams[param]);
zval_copy_ctor(return_value);
}

ZEND_BEGIN_ARG_INFO_EX(php_jit_signature_construct_arginfo, 0, 0, 1)
Expand Down
3 changes: 2 additions & 1 deletion bits/struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ PHP_METHOD(Struct, getFieldType) {
}

if (of < pstruct->nfields) {
ZVAL_ZVAL(return_value, &pstruct->zfields[of], 1, 0);
ZVAL_COPY_VALUE(return_value, &pstruct->zfields[of]);
zval_copy_ctor(return_value);
return;
}

Expand Down
6 changes: 4 additions & 2 deletions bits/value.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ PHP_METHOD(Value, getType) {
pval = PHP_JIT_FETCH_VALUE(getThis());

if (Z_TYPE(pval->ztype) != IS_NULL) {
ZVAL_ZVAL(return_value, &pval->ztype, 1, 0);
ZVAL_COPY_VALUE(return_value, &pval->ztype);
zval_copy_ctor(return_value);
}
}

Expand All @@ -307,7 +308,8 @@ PHP_METHOD(Value, getFunction) {
pval = PHP_JIT_FETCH_VALUE(getThis());

if (Z_TYPE(pval->zfunc) != IS_NULL) {
ZVAL_ZVAL(return_value, &pval->zfunc, 1, 0);
ZVAL_COPY_VALUE(return_value, &pval->zfunc);
zval_copy_ctor(return_value);
}
}

Expand Down
16 changes: 12 additions & 4 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ if test "$PHP_JITFU" != "no"; then
AC_MSG_ERROR([Please reinstall the libjit distribution])
fi

AC_MSG_CHECKING([... in $libdir ...])
PHP_ADD_INCLUDE($JITFU_DIR/include)

LIBNAME=jit # you may want to change this
Expand All @@ -34,12 +35,19 @@ if test "$PHP_JITFU" != "no"; then
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $JITFU_DIR/lib, JITFU_SHARED_LIBADD)
AC_DEFINE(HAVE_JITLIB,1,[ ])
],[
AC_MSG_ERROR([wrong libjit version or libjit not found])
PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
[
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $JITFU_DIR/lib64, JITFU_SHARED_LIBADD)
AC_DEFINE(HAVE_JITLIB,1,[ ])
],[
AC_MSG_ERROR([wrong libjit version or libjit not found])
],[
-L$JITFU_DIR/lib64 -lm
])
],[
-L$JITFU_DIR/lib -lm
-L$JITFU_DIR/$libdir -lm
])

PHP_SUBST(JITFU_SHARED_LIBADD)

PHP_NEW_EXTENSION(jitfu, jitfu.c, $ext_shared)
PHP_SUBST(JITFU_SHARED_LIBADD)
fi

0 comments on commit 82df549

Please sign in to comment.