Open mokraemer opened 3 years ago
TSRMLS_CC and TSRMLS_DC did not do anything anymore in PHP7 anyway, so they can be safely removed. Patch is easy:
diff --git a/jsmin.c b/jsmin.c
index 2744aef..773dc09 100644
--- a/jsmin.c
+++ b/jsmin.c
@@ -34,7 +34,7 @@ SOFTWARE.
*/
static jsmin_obj*
-new_jsmin_obj(char *javascript TSRMLS_DC)
+new_jsmin_obj(char *javascript)
{
jsmin_obj *jmo = ecalloc(1, sizeof(jsmin_obj));
jmo->javascript = javascript;
@@ -48,7 +48,7 @@ new_jsmin_obj(char *javascript TSRMLS_DC)
/* free_jsmin_obj -- frees up memory on struct
*/
void
-free_jsmin_obj(jsmin_obj *jmo TSRMLS_DC)
+free_jsmin_obj(jsmin_obj *jmo)
{
smart_string_free(&jmo->buffer);
efree(jmo);
@@ -250,9 +250,9 @@ jsmin_action(int d, jsmin_obj *jmo)
*/
jsmin_obj*
-jsmin(char *javascript TSRMLS_DC)
+jsmin(char *javascript)
{
- jsmin_obj *jmo = new_jsmin_obj(javascript TSRMLS_CC);
+ jsmin_obj *jmo = new_jsmin_obj(javascript);
jsmin_action(3, jmo);
while (jmo->theA != 0) {
diff --git a/jsmin.h b/jsmin.h
index 317b90b..0bda630 100644
--- a/jsmin.h
+++ b/jsmin.h
@@ -25,7 +25,7 @@ enum error_codes {
PHP_JSMIN_ERROR_UNTERMINATED_REGEX
};
-extern jsmin_obj* jsmin(char *javascript TSRMLS_DC);
-extern void free_jsmin_obj(jsmin_obj *jmo TSRMLS_DC);
+extern jsmin_obj* jsmin(char *javascript);
+extern void free_jsmin_obj(jsmin_obj *jmo);
#endif
diff --git a/php_jsmin.c b/php_jsmin.c
index a9783d4..6cc034a 100644
--- a/php_jsmin.c
+++ b/php_jsmin.c
@@ -105,11 +105,11 @@ PHP_FUNCTION(jsmin)
zval *ret_code = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &javascript, &javascript_len, &ret_code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/", &javascript, &javascript_len, &ret_code) == FAILURE) {
RETURN_FALSE;
}
- jmo = jsmin(javascript TSRMLS_CC);
+ jmo = jsmin(javascript);
if (ret_code) {
zval_dtor(ret_code);
ZVAL_LONG(ret_code, jmo->errorCode);
@@ -121,7 +121,7 @@ PHP_FUNCTION(jsmin)
} else {
ZVAL_STRINGL(return_value, jmo->buffer.c, jmo->buffer.len);
}
- free_jsmin_obj(jmo TSRMLS_CC);
+ free_jsmin_obj(jmo);
}
/* }}} */
This worked for me. Could this be made into a pull request?
Requested a PR based on @Jan-E's comment
Packaged it for Alpinelinux, would be great to package jquery into PECL release or skip it like https://github.com/sqmk/pecl-jsmin/pull/60
Awaiting 4.0.0 release!
I am using php7.4.30 as my php version. I do have php8.1 installed but it is not currently used. I am seeing the same issues as above https://github.com/sqmk/pecl-jsmin/issues/62
Sorry,How Can I Use Them? Just Run Or Install some plug?
will this receive php8 support?
Current release does not compile with php 8: