zenovich / runkit

Runkit (official PECL PHP Runkit extension)
http://pecl.php.net/runkit
Other
610 stars 136 forks source link

Cannot install/build it on Mac OS X Yosemite #84

Closed jnbdz closed 9 years ago

jnbdz commented 9 years ago

I was unable to compile it on my Mac OS X Yosemite:

./configure --enable-runkit

Then:

make

Here is the error I got:

/Users/jeannicolas/src/runkit/runkit_import.c:220:21: error: use of undeclared identifier 'IS_CONSTANT_ARRAY'
                                Z_TYPE_PP(c) == IS_CONSTANT_ARRAY
                                                ^
/Users/jeannicolas/src/runkit/runkit_import.c:226:32: error: incompatible pointer to integer conversion passing 'void *' to parameter of type
      'zend_bool' (aka 'unsigned char') [-Werror,-Wint-conversion]
                                zval_update_constant_ex(c, (void*) 1, dce TSRMLS_CC);
                                                           ^~~~~~~~~
/usr/local/Cellar/php56/5.6.11_2/include/php/Zend/zend_execute.h:164:59: note: passing argument to parameter 'inline_change' here
ZEND_API int zval_update_constant_ex(zval **pp, zend_bool inline_change, zend_class_entry *scope TSRMLS_DC);
                                                          ^
/Users/jeannicolas/src/runkit/runkit_import.c:289:31: error: incompatible pointer to integer conversion passing 'zend_class_entry *'
      (aka 'struct _zend_class_entry *') to parameter of type 'zend_bool' (aka 'unsigned char') [-Werror,-Wint-conversion]
                                        zval_update_constant(pp, dce TSRMLS_CC);
                                                                 ^~~
/usr/local/Cellar/php56/5.6.11_2/include/php/Zend/zend_execute.h:161:56: note: passing argument to parameter 'inline_change' here
ZEND_API int zval_update_constant(zval **pp, zend_bool inline_change TSRMLS_DC);
                                                       ^
/Users/jeannicolas/src/runkit/runkit_import.c:357:21: error: use of undeclared identifier 'IS_CONSTANT_ARRAY'
                                Z_TYPE_PP(p) == IS_CONSTANT_ARRAY
                                                ^
/Users/jeannicolas/src/runkit/runkit_import.c:363:32: error: incompatible pointer to integer conversion passing 'void *' to parameter of type
      'zend_bool' (aka 'unsigned char') [-Werror,-Wint-conversion]
                                zval_update_constant_ex(p, (void*) 1, dce TSRMLS_CC);
                                                           ^~~~~~~~~
/usr/local/Cellar/php56/5.6.11_2/include/php/Zend/zend_execute.h:164:59: note: passing argument to parameter 'inline_change' here
ZEND_API int zval_update_constant_ex(zval **pp, zend_bool inline_change, zend_class_entry *scope TSRMLS_DC);
                                                          ^
5 errors generated.
make: *** [runkit_import.lo] Error 1
eelf commented 9 years ago

Probably you have PHP 5.6 and UPGRADING.INTERNALS says

  1. Internal API changes k. Removal of IS_CONSTANT_ARRAY and IS_CONSTANT_INDEX hack

    These two #defines disappeared. Instead we have now IS_CONSTANT_AST which covers also the functionality IS_CONSTANT_ARRAY bid and furthermore the hack for marking zvals as constant index with IS_CONSTANT_INDEX is now superfluous and so removed. Please note that IS_CONSTANT_AST now has the same value than IS_CONSTANT_ARRAY had.

eelf commented 9 years ago

You can apply this patch https://github.com/eelf/runkit/commit/b70959188b2aa1c2c6cb76dcde50946e86979a0f just for your case, it also breaks backwards compatibility

jnbdz commented 9 years ago

Thanks!

zenovich commented 9 years ago

Fixed in #73