Skip to content

Commit

Permalink
php8.0 compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
vanillahsu committed Oct 27, 2020
1 parent a999deb commit b14b006
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
language: php

sudo: required
dist: precise
dist: focal

php:
- 5.5
- 5.6
- 7.4
- 8.0

env:
global:
- PHPIZE_BIN="$(which phpize 2> /dev/null || which phpize5 2> /dev/null)"
- PHPIZE_BIN="$(which phpize 2> /dev/null)"

before_script:
- $PHPIZE_BIN &> /dev/null
Expand All @@ -20,4 +20,4 @@ addons:
apt:
packages:
- libqrencode-dev
- libpng-dev
- libpng12-dev
17 changes: 16 additions & 1 deletion php_qrencode.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@
extern zend_module_entry qrencode_module_entry;
#define phpext_qrencode_ptr &qrencode_module_entry

#if PHP_VERSION_ID >= 80000
#ifndef TSRMLS_C
#define TSRMLS_C
#endif
#ifndef TSRMLS_CC
#define TSRMLS_CC
#endif
#ifndef TSRMLS_D
#define TSRMLS_D
#endif
#ifndef TSRMLS_DC
#define TSRMLS_DC
#endif
#endif

#ifdef PHP_WIN32
#define PHP_QRENCODE_API __declspec(dllexport)
#else
Expand All @@ -31,7 +46,7 @@ extern zend_module_entry qrencode_module_entry;
#include "TSRM.h"
#endif

#define PHP_QRENCODE_VERSION "0.6"
#define PHP_QRENCODE_VERSION "0.7"

PHP_MINIT_FUNCTION(qrencode);
PHP_MSHUTDOWN_FUNCTION(qrencode);
Expand Down

0 comments on commit b14b006

Please sign in to comment.