[libvirt] [libvirt-php PATCH] Add missing zend_ulong64 definition for PHP7+

Michal Privoznik mprivozn at redhat.com
Fri Apr 15 10:07:36 UTC 2016


On 14.04.2016 20:06, Neal Gompa wrote:
> In PHP 7.0, the zend_ulong64 definition was removed in favor
> of zend_ulong changing depending on whether PHP was compiled on
> a 64-bit architecture or not. However, we need 64-bit wide unsigned
> numbers, so the definition has been added for when it is compiled
> against PHP 7.0 or newer.
> 
> The patch set that originally ported libvirt-php to PHP7+ did not
> use zend_ulong64. However, it was altered to use it during the review,
> which broke PHP 7.0 support. This fixes that.
> ---
>  src/libvirt-php.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libvirt-php.c b/src/libvirt-php.c
> index 7dcead8..91bb1c5 100644
> --- a/src/libvirt-php.c
> +++ b/src/libvirt-php.c
> @@ -57,7 +57,7 @@ const char *features_binaries[] = { NULL };
>  
>  #if PHP_MAJOR_VERSION >= 7
>  typedef size_t strsize_t;
> -
> +typedef uint64_t zend_ulong64;
>  
>  #define VIRT_FETCH_RESOURCE(_state, _type, _zval, _name, _le) \
>  	if ((_state = (_type)zend_fetch_resource(Z_RES_P(*_zval), _name, _le)) == NULL) { \
> 

Okay, I actually had to check php code, because the lack of
documentation for their API is just a fact that I can do nothing about.
There is no long long for zend_parse_parameters(); there's even no
unsigned long. Le sigh. So we need a different approach here than I made
yesterday.

Michal




More information about the libvir-list mailing list