On 1/24/2021 2:13 AM, Benedikt Carda wrote:
Hello,

I am new to this list and don't feel (due to my non-existant C skills) to belong here, but I need a PECL package that is unmaintained and therefore not available for PHP 7: https://pecl.php.net/package/pcsc

I tried to compile it and it throws some errors where I feel somewhat confident that I can solve them. It seems like basic syntax changes. E.g. I found out that I had to replace |zend_rsrc_list_entry ||by |||zend_resource ||(following this blog post: http://www.sklar.com/software/php/2015/03/23/converting-a-php-extension-to-php-7/).

But there are other errors like "error: expected expression before" when calling ZEND_FETCH_RESOURCE or "error: macro "RETVAL_STRING" passed 2 arguments, but takes just 1".

Seem to me like very basic things to solve, but I can't find any reference / manual where I can find the usage of these functions and which parameters the function expects. Can anybody give me some hints where to search for this information? Maybe there is also a migration guide for PHP extensions from PHP 5 to PHP 7 somewhere.

Best Regards,
Benedikt.

My recommendation is to search the 'ext' directory of the PHP source code. It's a good place to find current, working examples. The majority of PHP is actually a series of extensions.

You can also look at PECL extensions that have been around for a while. I maintain PECL sync, which has #ifdef macros that allow it to compile for both PHP 5 and 7 (not that PHP 5 support is relevant anymore). I think PECL sync is a pretty good example since it is a fairly short, easily understood, real-world extension with no additional dependencies.

--
Thomas Hruska
CubicleSoft President

CubicleSoft has over 80 original open source projects and counting.
Plus a couple of commercial/retail products.

What software are you looking to build?

--
PECL development discussion Mailing List (https://pecl.php.net/)
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to