hjr3 / pecl-gearman

PHP wrapper to libgearman
Other
46 stars 24 forks source link

Error compiling with PHP 5.6.3 with thread-safe support enabled #10

Open flavioheleno opened 9 years ago

flavioheleno commented 9 years ago

I'm compiling PHP 5.6.3 from git with thread-safe support (--enable-maintainer-zts) along with this extension (also from git) and during the process, the compilation returns an error:

/tmp/php-src/ext/gearman/php_gearman.c: In function ‘_php_task_cb_fn’:
/tmp/php-src/ext/gearman/php_gearman.c:2633:3: error: too few arguments to function ‘zend_objects_store_add_ref_by_handle’
   zend_objects_store_add_ref_by_handle(task->value.handle);
   ^
In file included from /tmp/php-src/Zend/zend_globals.h:35:0,
                 from /tmp/php-src/Zend/zend_compile.h:431,
                 from /tmp/php-src/Zend/zend_modules.h:26,
                 from /tmp/php-src/Zend/zend_API.h:26,
                 from /tmp/php-src/main/php.h:39,
                 from /tmp/php-src/ext/gearman/php_gearman.c:16:
/tmp/php-src/Zend/zend_objects_API.h:70:15: note: declared here
 ZEND_API void zend_objects_store_add_ref_by_handle(zend_object_handle handle TSRMLS_DC);
               ^
/tmp/php-src/ext/gearman/php_gearman.c:2670:3: error: too few arguments to function ‘zend_objects_store_del_ref_by_handle’
   zend_objects_store_del_ref_by_handle(task->value.handle);
   ^
In file included from /tmp/php-src/Zend/zend_globals.h:35:0,
                 from /tmp/php-src/Zend/zend_compile.h:431,
                 from /tmp/php-src/Zend/zend_modules.h:26,
                 from /tmp/php-src/Zend/zend_API.h:26,
                 from /tmp/php-src/main/php.h:39,
                 from /tmp/php-src/ext/gearman/php_gearman.c:16:
/tmp/php-src/Zend/zend_objects_API.h:72:32: note: declared here
 static zend_always_inline void zend_objects_store_del_ref_by_handle(zend_object_handle handle TSRMLS_DC) {
                                ^
make: *** [ext/gearman/php_gearman.lo] Error 1

I've fixed this by changing line 2633 from:

zend_objects_store_add_ref_by_handle(task->value.handle);

to:

zend_objects_store_add_ref_by_handle(task->value.handle TSRMLS_CC);

and line 2670 from:

zend_objects_store_del_ref_by_handle(task->value.handle);

to:

zend_objects_store_del_ref_by_handle(task->value.handle TSRMLS_CC);