decred / dcrpayments

mono repo that houses various libraries/utilities for accepting Decred payments
8 stars 6 forks source link

Can not install PHP_Blake #12

Closed vctt94 closed 6 years ago

vctt94 commented 6 years ago

trying to install php_blake from https://github.com/decred/dcrpayments/tree/master/PHP_Blake I got this log:

/bin/bash /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/libtool --mode=compile cc  -I. -I/home/victor/MyProjects/decred/dcrpayments/PHP_Blake -DPHP_ATOM_INC -I/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/include -I/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/main -I/home/victor/MyProjects/decred/dcrpayments/PHP_Blake -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c -o blake.lo 
libtool: compile:  cc -I. -I/home/victor/MyProjects/decred/dcrpayments/PHP_Blake -DPHP_ATOM_INC -I/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/include -I/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/main -I/home/victor/MyProjects/decred/dcrpayments/PHP_Blake -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c  -fPIC -DPIC -o .libs/blake.o
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c: In function '_php_blake_hash':
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:773:42: error: macro "RETURN_STRINGL" requires 3 arguments, but only 2 given
         RETURN_STRINGL(digest, digest_len);
                                          ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:773:9: error: 'RETURN_STRINGL' undeclared (first use in this function)
         RETURN_STRINGL(digest, digest_len);
         ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:773:9: note: each undeclared identifier is reported only once for each function it appears in
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:779:50: error: macro "RETURN_STRINGL" requires 3 arguments, but only 2 given
         RETURN_STRINGL(hex_digest, 2 * digest_len);
                                                  ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c: In function 'zif_blake_init':
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:832:5: warning: passing argument 1 of 'zend_register_resource' from incompatible pointer type [enabled by default]
     RETURN_RES(zend_register_resource(state, php_blake_le_hashstate));
     ^
In file included from /usr/include/php5/Zend/zend_API.h:27:0,
                 from /usr/include/php5/main/php.h:39,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/php_blake.h:24,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:25:
/usr/include/php5/Zend/zend_list.h:82:14: note: expected 'struct zval *' but argument is of type 'struct php_hash_state *'
 ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC);
              ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:832:5: warning: passing argument 2 of 'zend_register_resource' makes pointer from integer without a cast [enabled by default]
     RETURN_RES(zend_register_resource(state, php_blake_le_hashstate));
     ^
In file included from /usr/include/php5/Zend/zend_API.h:27:0,
                 from /usr/include/php5/main/php.h:39,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/php_blake.h:24,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:25:
/usr/include/php5/Zend/zend_list.h:82:14: note: expected 'void *' but argument is of type 'int'
 ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC);
              ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:832:5: error: too few arguments to function 'zend_register_resource'
     RETURN_RES(zend_register_resource(state, php_blake_le_hashstate));
     ^
In file included from /usr/include/php5/Zend/zend_API.h:27:0,
                 from /usr/include/php5/main/php.h:39,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/php_blake.h:24,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:25:
/usr/include/php5/Zend/zend_list.h:82:14: note: declared here
 ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC);
              ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c: In function 'zif_blake_update':
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:848:5: warning: passing argument 1 of 'zend_fetch_resource' makes pointer from integer without a cast [enabled by default]
     if ((state = (php_hash_state *)zend_fetch_resource(Z_RES_P(zhash), PHP_BLAKE_RES_NAME, php_blake_le_hashstate)) == NULL) {
     ^
In file included from /usr/include/php5/Zend/zend_API.h:27:0,
                 from /usr/include/php5/main/php.h:39,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/php_blake.h:24,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:25:
/usr/include/php5/Zend/zend_list.h:83:16: note: expected 'struct zval **' but argument is of type 'int'
 ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
                ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:848:5: warning: passing argument 2 of 'zend_fetch_resource' makes integer from pointer without a cast [enabled by default]
     if ((state = (php_hash_state *)zend_fetch_resource(Z_RES_P(zhash), PHP_BLAKE_RES_NAME, php_blake_le_hashstate)) == NULL) {
     ^
In file included from /usr/include/php5/Zend/zend_API.h:27:0,
                 from /usr/include/php5/main/php.h:39,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/php_blake.h:24,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:25:
/usr/include/php5/Zend/zend_list.h:83:16: note: expected 'int' but argument is of type 'char *'
 ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
                ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:848:5: warning: passing argument 3 of 'zend_fetch_resource' makes pointer from integer without a cast [enabled by default]
     if ((state = (php_hash_state *)zend_fetch_resource(Z_RES_P(zhash), PHP_BLAKE_RES_NAME, php_blake_le_hashstate)) == NULL) {
     ^
In file included from /usr/include/php5/Zend/zend_API.h:27:0,
                 from /usr/include/php5/main/php.h:39,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/php_blake.h:24,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:25:
/usr/include/php5/Zend/zend_list.h:83:16: note: expected 'const char *' but argument is of type 'int'
 ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
                ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:848:5: error: too few arguments to function 'zend_fetch_resource'
     if ((state = (php_hash_state *)zend_fetch_resource(Z_RES_P(zhash), PHP_BLAKE_RES_NAME, php_blake_le_hashstate)) == NULL) {
     ^
In file included from /usr/include/php5/Zend/zend_API.h:27:0,
                 from /usr/include/php5/main/php.h:39,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/php_blake.h:24,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:25:
/usr/include/php5/Zend/zend_list.h:83:16: note: declared here
 ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
                ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c: In function 'zif_blake_final':
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:865:5: error: unknown type name 'zend_resource'
     zend_resource *le;
     ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:873:5: warning: passing argument 1 of 'zend_fetch_resource' makes pointer from integer without a cast [enabled by default]
     if ((state = (php_hash_state *)zend_fetch_resource(Z_RES_P(zhash), PHP_BLAKE_RES_NAME, php_blake_le_hashstate)) == NULL) {
     ^
In file included from /usr/include/php5/Zend/zend_API.h:27:0,
                 from /usr/include/php5/main/php.h:39,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/php_blake.h:24,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:25:
/usr/include/php5/Zend/zend_list.h:83:16: note: expected 'struct zval **' but argument is of type 'int'
 ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
                ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:873:5: warning: passing argument 2 of 'zend_fetch_resource' makes integer from pointer without a cast [enabled by default]
     if ((state = (php_hash_state *)zend_fetch_resource(Z_RES_P(zhash), PHP_BLAKE_RES_NAME, php_blake_le_hashstate)) == NULL) {
     ^
In file included from /usr/include/php5/Zend/zend_API.h:27:0,
                 from /usr/include/php5/main/php.h:39,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/php_blake.h:24,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:25:
/usr/include/php5/Zend/zend_list.h:83:16: note: expected 'int' but argument is of type 'char *'
 ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
                ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:873:5: warning: passing argument 3 of 'zend_fetch_resource' makes pointer from integer without a cast [enabled by default]
     if ((state = (php_hash_state *)zend_fetch_resource(Z_RES_P(zhash), PHP_BLAKE_RES_NAME, php_blake_le_hashstate)) == NULL) {
     ^
In file included from /usr/include/php5/Zend/zend_API.h:27:0,
                 from /usr/include/php5/main/php.h:39,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/php_blake.h:24,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:25:
/usr/include/php5/Zend/zend_list.h:83:16: note: expected 'const char *' but argument is of type 'int'
 ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
                ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:873:5: error: too few arguments to function 'zend_fetch_resource'
     if ((state = (php_hash_state *)zend_fetch_resource(Z_RES_P(zhash), PHP_BLAKE_RES_NAME, php_blake_le_hashstate)) == NULL) {
     ^
In file included from /usr/include/php5/Zend/zend_API.h:27:0,
                 from /usr/include/php5/main/php.h:39,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/php_blake.h:24,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:25:
/usr/include/php5/Zend/zend_list.h:83:16: note: declared here
 ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, const char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
                ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:887:63: error: invalid type argument of '->' (have 'int')
     if (zend_hash_index_find(&EG(regular_list), Z_RES_P(zhash)->handle)==SUCCESS) {
                                                               ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:887:5: error: too few arguments to function 'zend_hash_index_find'
     if (zend_hash_index_find(&EG(regular_list), Z_RES_P(zhash)->handle)==SUCCESS) {
     ^
In file included from /usr/include/php5/Zend/zend.h:286:0,
                 from /usr/include/php5/main/php.h:35,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/php_blake.h:24,
                 from /home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:25:
/usr/include/php5/Zend/zend_hash.h:166:14: note: declared here
 ZEND_API int zend_hash_index_find(const HashTable *ht, ulong h, void **pData);
              ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:895:42: error: macro "RETURN_STRINGL" requires 3 arguments, but only 2 given
         RETURN_STRINGL(digest, digest_len);
                                          ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:895:9: error: 'RETURN_STRINGL' undeclared (first use in this function)
         RETURN_STRINGL(digest, digest_len);
         ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:901:50: error: macro "RETURN_STRINGL" requires 3 arguments, but only 2 given
         RETURN_STRINGL(hex_digest, 2 * digest_len);
                                                  ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c: At top level:
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:908:33: error: unknown type name 'zend_resource'
 static void php_hash_state_dtor(zend_resource *rsrc TSRMLS_DC)
                                 ^
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c: In function 'zm_startup_blake':
/home/victor/MyProjects/decred/dcrpayments/PHP_Blake/blake.c:921:64: error: 'php_hash_state_dtor' undeclared (first use in this function)
     php_blake_le_hashstate = zend_register_list_destructors_ex(php_hash_state_dtor, NULL, PHP_BLAKE_RES_NAME, module_number);
                                                                ^
make: *** [blake.lo] Error 1

Installing from https://github.com/BlueDragon747/PHP_Blake worked fine.

jolan commented 6 years ago

What OS is this on?

PHP5 isn't actively supported anymore and is only receiving major security fixes:

http://php.net/supported-versions.php

So I didn't really see a reason to support PHP5.

vctt94 commented 6 years ago

My php7 and php5 was conflicting I think. I updated it and seems like it is fixed now.