iliaal / php_excel

PHP Extension interface to the Excel writing/reading library
http://ilia.ws
533 stars 131 forks source link

PHP8 branch: What version of PHP 8 and what version of LibXL does it require? #273

Closed sabutterworth closed 2 years ago

sabutterworth commented 2 years ago

It didn't compile on PHP 8.0.10 using LibXL (3.8.0.0) on Ubuntu 18.04 LTS:

/usr/local/src/php_excel-php8/excel.c:4390:2: error: 'add_assoc_string' undeclared (first use in this function); did you mean 'add_assoc_string_ex'? add_assoc_string(return_value, "hyperlink", (char *)s, 1); ^~~~~~~~~~~~~~~~ add_assoc_string_ex /usr/local/src/php_excel-php8/excel.c: In function 'zim_ExcelSheet_delHyperlink': /usr/local/src/php_excel-php8/excel.c:4406:44: error: expected ')' before 'TSRMLS_CC' if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { ^~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:4406:6: error: too few arguments to function 'zend_parse_parameters' if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { ^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/php/20200930/main/php.h:36:0, from /usr/local/src/php_excel-php8/excel.c:26: /usr/include/php/20200930/Zend/zend_API.h:304:22: note: declared here ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec, ...); ^~~~~~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:130:87: error: expected ')' before 'TSRMLS_CC' excel_sheet_object *obj = (excel_sheet_object*) zend_object_store_get_object(object TSRMLS_CC); \ ^ /usr/local/src/php_excel-php8/excel.c:4414:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:130:29: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] excel_sheet_object *obj = (excel_sheet_object*) zend_object_store_get_object(object TSRMLS_CC); \ ^ /usr/local/src/php_excel-php8/excel.c:4414:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:133:26: error: expected ')' before 'TSRMLS_CC' php_error_docref(NULL TSRMLS_CC, E_WARNING, "The sheet wasn't initialized"); \ ^ /usr/local/src/php_excel-php8/excel.c:4414:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:133:4: error: too few arguments to function 'php_error_docref' php_error_docref(NULL TSRMLS_CC, E_WARNING, "The sheet wasn't initialized"); \ ^ /usr/local/src/php_excel-php8/excel.c:4414:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ In file included from /usr/local/src/php_excel-php8/excel.c:26:0: /usr/include/php/20200930/main/php.h:342:23: note: declared here PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format, ...) ^~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c: In function 'zim_ExcelSheet_addHyperlink': /usr/local/src/php_excel-php8/excel.c:4429:44: error: expected ')' before 'TSRMLS_CC' if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sllll", &val, &val_len, &row_first, &row_last, &col_first, &col_last) == FAILURE) { ^~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:4429:6: error: too few arguments to function 'zend_parse_parameters' if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sllll", &val, &val_len, &row_first, &row_last, &col_first, &col_last) == FAILURE) { ^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/php/20200930/main/php.h:36:0, from /usr/local/src/php_excel-php8/excel.c:26: /usr/include/php/20200930/Zend/zend_API.h:304:22: note: declared here ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec, ...); ^~~~~~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:130:87: error: expected ')' before 'TSRMLS_CC' excel_sheet_object *obj = (excel_sheet_object*) zend_object_store_get_object(object TSRMLS_CC); \ ^ /usr/local/src/php_excel-php8/excel.c:4433:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:130:29: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] excel_sheet_object *obj = (excel_sheet_object*) zend_object_store_get_object(object TSRMLS_CC); \ ^ /usr/local/src/php_excel-php8/excel.c:4433:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:133:26: error: expected ')' before 'TSRMLS_CC' php_error_docref(NULL TSRMLS_CC, E_WARNING, "The sheet wasn't initialized"); \ ^ /usr/local/src/php_excel-php8/excel.c:4433:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:133:4: error: too few arguments to function 'php_error_docref' php_error_docref(NULL TSRMLS_CC, E_WARNING, "The sheet wasn't initialized"); \ ^ /usr/local/src/php_excel-php8/excel.c:4433:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ In file included from /usr/local/src/php_excel-php8/excel.c:26:0: /usr/include/php/20200930/main/php.h:342:23: note: declared here PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format, ...) ^~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c: In function 'zim_ExcelSheet_mergeSize': /usr/local/src/php_excel-php8/excel.c:130:87: error: expected ')' before 'TSRMLS_CC' excel_sheet_object *obj = (excel_sheet_object*) zend_object_store_get_object(object TSRMLS_CC); \ ^ /usr/local/src/php_excel-php8/excel.c:4451:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:130:29: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] excel_sheet_object *obj = (excel_sheet_object*) zend_object_store_get_object(object TSRMLS_CC); \ ^ /usr/local/src/php_excel-php8/excel.c:4451:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:133:26: error: expected ')' before 'TSRMLS_CC' php_error_docref(NULL TSRMLS_CC, E_WARNING, "The sheet wasn't initialized"); \ ^ /usr/local/src/php_excel-php8/excel.c:4451:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:133:4: error: too few arguments to function 'php_error_docref' php_error_docref(NULL TSRMLS_CC, E_WARNING, "The sheet wasn't initialized"); \ ^ /usr/local/src/php_excel-php8/excel.c:4451:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ In file included from /usr/local/src/php_excel-php8/excel.c:26:0: /usr/include/php/20200930/main/php.h:342:23: note: declared here PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format, ...) ^~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c: In function 'zim_ExcelSheet_merge': /usr/local/src/php_excel-php8/excel.c:4465:44: error: expected ')' before 'TSRMLS_CC' if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { ^~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:4465:6: error: too few arguments to function 'zend_parse_parameters' if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { ^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/php/20200930/main/php.h:36:0, from /usr/local/src/php_excel-php8/excel.c:26: /usr/include/php/20200930/Zend/zend_API.h:304:22: note: declared here ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec, ...); ^~~~~~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:130:87: error: expected ')' before 'TSRMLS_CC' excel_sheet_object *obj = (excel_sheet_object*) zend_object_store_get_object(object TSRMLS_CC); \ ^ /usr/local/src/php_excel-php8/excel.c:4473:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:130:29: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] excel_sheet_object *obj = (excel_sheet_object*) zend_object_store_get_object(object TSRMLS_CC); \ ^ /usr/local/src/php_excel-php8/excel.c:4473:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:133:26: error: expected ')' before 'TSRMLS_CC' php_error_docref(NULL TSRMLS_CC, E_WARNING, "The sheet wasn't initialized"); \ ^ /usr/local/src/php_excel-php8/excel.c:4473:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:133:4: error: too few arguments to function 'php_error_docref' php_error_docref(NULL TSRMLS_CC, E_WARNING, "The sheet wasn't initialized"); \ ^ /usr/local/src/php_excel-php8/excel.c:4473:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ In file included from /usr/local/src/php_excel-php8/excel.c:26:0: /usr/include/php/20200930/main/php.h:342:23: note: declared here PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format, ...) ^~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c: In function 'zim_ExcelSheet_delMergeByIndex': /usr/local/src/php_excel-php8/excel.c:4495:44: error: expected ')' before 'TSRMLS_CC' if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { ^~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:4495:6: error: too few arguments to function 'zend_parse_parameters' if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) { ^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/php/20200930/main/php.h:36:0, from /usr/local/src/php_excel-php8/excel.c:26: /usr/include/php/20200930/Zend/zend_API.h:304:22: note: declared here ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec, ...); ^~~~~~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:130:87: error: expected ')' before 'TSRMLS_CC' excel_sheet_object *obj = (excel_sheet_object*) zend_object_store_get_object(object TSRMLS_CC); \ ^ /usr/local/src/php_excel-php8/excel.c:4503:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:130:29: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] excel_sheet_object *obj = (excel_sheet_object*) zend_object_store_get_object(object TSRMLS_CC); \ ^ /usr/local/src/php_excel-php8/excel.c:4503:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:133:26: error: expected ')' before 'TSRMLS_CC' php_error_docref(NULL TSRMLS_CC, E_WARNING, "The sheet wasn't initialized"); \ ^ /usr/local/src/php_excel-php8/excel.c:4503:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ /usr/local/src/php_excel-php8/excel.c:133:4: error: too few arguments to function 'php_error_docref' php_error_docref(NULL TSRMLS_CC, E_WARNING, "The sheet wasn't initialized"); \ ^ /usr/local/src/php_excel-php8/excel.c:4503:2: note: in expansion of macro 'SHEET_FROM_OBJECT' SHEET_FROM_OBJECT(sheet, object); ^~~~~~~~~~~~~~~~~ In file inc... (more after this)

Jan-E commented 2 years ago

Could you try the php7_with_pulls branch of https://github.com/Jan-E/php_excel/ ? AFAIK it works with many versions of LibXL including 3.8.0.0.

do-io commented 2 years ago

@Jan-E is correct. The php7_with_pulls is php8 compatible and works with the latest LibXL 3.8.0.0 version