msgpack / msgpack-php

msgpack.org[PHP]
BSD 3-Clause "New" or "Revised" License
773 stars 119 forks source link

Unable to compile with PHP 7.4.0 on macOS 10.15.1 #141

Closed panosru closed 4 years ago

panosru commented 4 years ago

I tried with both pecl and manual compile, both ended up with the same error: image I'm on macOS 10.15.1

rybakit commented 4 years ago

It works on Linux: https://travis-ci.org/tarantool-php/client/jobs/619782342#L158-L160

panosru commented 4 years ago

Indeed, it seems to be working on Linux; thus I changed the title of the topic accordingly

panosru commented 4 years ago

image

Could anyone at least point me on where to look to solve that issue? I can see based on the errors that it does not recognise the zend types (or something related to zend), does that means that the compiler may be missing some paths? Should I try addition some paths before compiling that might solve the issue?

Thanks!

nagaho commented 4 years ago

It works on macOS and php-7.4.

diff --git a/msgpack_convert.c b/msgpack_convert.c
index b1d4334..2fdafa1 100644
--- a/msgpack_convert.c
+++ b/msgpack_convert.c
@@ -11,7 +11,7 @@ static inline int msgpack_convert_long_to_properties(HashTable *ht, zval *object
     if (props != NULL) {
         zval *data, tplval, *dataval, prop_key_zv;
         zend_string *prop_key;
-        ulong prop_key_index;
+        zend_ulong prop_key_index;
         const char *class_name, *prop_name;
         size_t prop_len;

@@ -102,7 +102,7 @@ static inline int msgpack_convert_string_to_properties(zval *object, zend_string
 int msgpack_convert_array(zval *return_value, zval *tpl, zval *value) /* {{{ */ {
     zend_string *key;
     int key_type;
-    ulong key_index;
+    zend_ulong key_index;
     zval *data;
     HashTable *ht, *htval;

@@ -329,7 +329,7 @@ int msgpack_convert_object(zval *return_value, zval *tpl, zval *value) /* {{{ */
             HashTable *ht, *ret, *var = NULL;
             zend_string *str_key;
             zval *data;
-            ulong num_key;
+            zend_ulong num_key;

             ht = HASH_OF(value);
             ret = HASH_OF(return_value);
panosru commented 4 years ago

@nagaho yup! Now it works! Thanks!

cmb69 commented 4 years ago

This affects Windows as well, and is caused by https://github.com/php/php-src/commit/bebcdcc74573b015c22238dbc9b2698c88b7a601. I suggest to re-open this ticket.