Skip to content

is not compiled under PHP7 #1

@ildar-aim

Description

@ildar-aim
aim-server[~/tmp/mysql_unserialize_php]$ gitdiff .
diff --git a/Makefile b/Makefile
index 085405f..a46789e 100644
--- a/Makefile
+++ b/Makefile
@@ -2,10 +2,11 @@ BASE =
 CC = g++
 STRIP = strip
 CFLAGS = -Wall -g -fPIC \
-        -I$(BASE)/usr/include/php5 \
-        -I$(BASE)/usr/include/php5/main \
-        -I$(BASE)/usr/include/php5/Zend \
-        -I$(BASE)/usr/include/php5/TSRM \
+        -I$(BASE)/usr/include/php \
+        -I$(BASE)/usr/include/php/main \
+        -I$(BASE)/usr/include/php/Zend \
+        -I$(BASE)/usr/include/php/TSRM \
+        -I$(BASE)/usr/include/php/sapi/embed \
         -I$(BASE)/usr/include/mysql
 LFLAGS = -lresolv -lcrypt -ldl -L$(BASE)/usr/lib -lphp5embedded -fPIC 

aim-server[~/tmp/mysql_unserialize_php]$ make
g++ -Wall -g -fPIC -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/Zend -I/usr/include/php/TSRM -I/usr/include/php/sapi/embed -I/usr/include/mysql -c unserialize_php.cc -o unserialize_php.o 
g++ -Wall -g -fPIC -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/Zend -I/usr/include/php/TSRM -I/usr/include/php/sapi/embed -I/usr/include/mysql -c pfc.cc -o pfc.o 
pfc.cc:18:50: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
     ZVAL_STRINGL(var, (char *)value, value_len, 1);
                                                  ^
pfc.cc:22:54: error: macro "zend_hash_update" passed 6 arguments, but takes just 3
                            &var, sizeof(zval *), NULL);
                                                      ^
pfc.cc: In function ‘void pfc_set_string(const char*, const char*, size_t, size_t)’:
pfc.cc:17:22: error: ‘MAKE_STD_ZVAL’ was not declared in this scope
     MAKE_STD_ZVAL(var);
                      ^
pfc.cc:18:5: error: ‘ZVAL_STRINGL’ was not declared in this scope
     ZVAL_STRINGL(var, (char *)value, value_len, 1);
     ^
pfc.cc:21:11: error: ‘zend_hash_update’ was not declared in this scope
     (void)zend_hash_update(&EG(symbol_table), (char *)name, name_len,
           ^
pfc.cc: In function ‘bool pfc_get_string(const char*, std::__cxx11::string*, size_t)’:
pfc.cc:35:31: error: cannot convert ‘char*’ to ‘zend_string* {aka _zend_string*}’ for argument ‘2’ to ‘zval* zend_hash_find(const HashTable*, zend_string*)’
                 (void **)&data) == FAILURE) {
                               ^
pfc.cc: At global scope:
pfc.cc:139:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
 };
 ^
pfc.cc:139:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
pfc.cc:139:1: error: invalid conversion from ‘int (*)(const char*, uint) {aka int (*)(const char*, unsigned int)}’ to ‘size_t (*)(const char*, size_t) {aka long unsigned int (*)(const char*, long unsigned int)}’ [-fpermissive]
pfc.cc: In function ‘bool pfc_initialize()’:
pfc.cc:187:58: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
     php_register_variable("PHP_SELF", "-", NULL TSRMLS_CC);
                                                          ^
pfc.cc:187:58: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
Makefile:14: recipe for target 'pfc.o' failed
make: *** [pfc.o] Error 1
aim-server[~/tmp/mysql_unserialize_php]$ /usr/bin/php -v  
PHP 7.0.4 (cli) (built: Mar  2 2016 18:46:30) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Xdebug v2.4.0RC4, Copyright (c) 2002-2016, by Derick Rethans
aim-server[~/tmp/mysql_unserialize_php]$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions