Skip to content

Commit

Permalink
Supported PHP 7
Browse files Browse the repository at this point in the history
  • Loading branch information
kjdev committed Sep 23, 2015
1 parent 919f51a commit cddaf2c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ php:
- 5.4
- 5.5
- 5.6
- nightly

env:
- REPORT_EXIT_STATUS=1 NO_INTERACTION=1
Expand Down
8 changes: 8 additions & 0 deletions lz4.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ static ZEND_FUNCTION(lz4_compress)
if (output_len <= 0) {
RETVAL_FALSE;
} else {
#if ZEND_MODULE_API_NO >= 20141001
RETVAL_STRINGL(output, output_len + offset);
#else
RETVAL_STRINGL(output, output_len + offset, 1);
#endif
}

efree(output);
Expand Down Expand Up @@ -197,7 +201,11 @@ static ZEND_FUNCTION(lz4_uncompress)
zend_error(E_WARNING, "lz4_uncompress : data error");
RETVAL_FALSE;
} else {
#if ZEND_MODULE_API_NO >= 20141001
RETVAL_STRINGL(output, output_len);
#else
RETVAL_STRINGL(output, output_len, 1);
#endif
}

free(output);
Expand Down

0 comments on commit cddaf2c

Please sign in to comment.