hightman/scws

直接git clone下来的代码,编译php8.0扩展的时候报错了

Closed this issue · 4 comments

错误信息如下
In file included from /root/src/scws/phpext/php_scws.c:186:0:
/root/src/scws/phpext/scws_arginfo.h:72:82: error: expected ‘)’ before numeric constant
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleCWS_close, 0, 0, IS_VOID, 0)
^
/root/src/scws/phpext/scws_arginfo.h:75:85: error: expected ‘)’ before numeric constant
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleCWS_add_dict, 0, 1, _IS_BOOL, 0)
^
In file included from /www/server/php/80/include/php/main/php.h:35:0,
from /root/src/scws/phpext/php_scws.c:25:
/www/server/php/80/include/php/Zend/zend_API.h:122:99: error: expected identifier or ‘(’ before ‘,’ token
{ #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), NULL },
^
/root/src/scws/phpext/scws_arginfo.h:76:2: note: in expansion of macro ‘ZEND_ARG_TYPE_INFO’
ZEND_ARG_TYPE_INFO(0, dict_path, IS_STRING, 0)
^
/www/server/php/80/include/php/Zend/zend_API.h:124:108: error: expected identifier or ‘(’ before ‘,’ token
{ #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), default_value },
^
/root/src/scws/phpext/scws_arginfo.h:77:2: note: in expansion of macro ‘ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE’
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "SCWS_XDICT_XDB")
^
In file included from /root/src/scws/phpext/php_scws.c:186:0:
/root/src/scws/phpext/scws_arginfo.h:80:88: error: expected ‘)’ before numeric constant
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleCWS_set_charset, 0, 1, _IS_BOOL, 0)
^
In file included from /www/server/php/80/include/php/main/php.h:35:0,
from /root/src/scws/phpext/php_scws.c:25:
/www/server/php/80/include/php/Zend/zend_API.h:122:99: error: expected identifier or ‘(’ before ‘,’ token
{ #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), NULL },
^
/root/src/scws/phpext/scws_arginfo.h:81:2: note: in expansion of macro ‘ZEND_ARG_TYPE_INFO’
ZEND_ARG_TYPE_INFO(0, charset, IS_STRING, 0)
^
In file included from /root/src/scws/phpext/php_scws.c:186:0:
/root/src/scws/phpext/scws_arginfo.h:86:85: error: expected ‘)’ before numeric constant
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleCWS_set_rule, 0, 1, _IS_BOOL, 0)
^
In file included from /www/server/php/80/include/php/main/php.h:35:0,
from /root/src/scws/phpext/php_scws.c:25:
/www/server/php/80/include/php/Zend/zend_API.h:122:99: error: expected identifier or ‘(’ before ‘,’ token
{ #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), NULL },
^
/root/src/scws/phpext/scws_arginfo.h:87:2: note: in expansion of macro ‘ZEND_ARG_TYPE_INFO’
ZEND_ARG_TYPE_INFO(0, rule_path, IS_STRING, 0)
^
In file included from /root/src/scws/phpext/php_scws.c:186:0:
/root/src/scws/phpext/scws_arginfo.h:90:87: error: expected ‘)’ before numeric constant
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleCWS_set_ignore, 0, 1, _IS_BOOL, 0)
^
In file included from /www/server/php/80/include/php/main/php.h:35:0,
from /root/src/scws/phpext/php_scws.c:25:
/www/server/php/80/include/php/Zend/zend_API.h:122:99: error: expected identifier or ‘(’ before ‘,’ token
{ #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), NULL },
^
/root/src/scws/phpext/scws_arginfo.h:91:2: note: in expansion of macro ‘ZEND_ARG_TYPE_INFO’
ZEND_ARG_TYPE_INFO(0, yes, _IS_BOOL, 0)
^
In file included from /root/src/scws/phpext/php_scws.c:186:0:
/root/src/scws/phpext/scws_arginfo.h:94:86: error: expected ‘)’ before numeric constant
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleCWS_set_multi, 0, 1, _IS_BOOL, 0)
^
In file included from /www/server/php/80/include/php/main/php.h:35:0,
from /root/src/scws/phpext/php_scws.c:25:
/www/server/php/80/include/php/Zend/zend_API.h:122:99: error: expected identifier or ‘(’ before ‘,’ token
{ #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), NULL },
^
/root/src/scws/phpext/scws_arginfo.h:95:2: note: in expansion of macro ‘ZEND_ARG_TYPE_INFO’
ZEND_ARG_TYPE_INFO(0, multi, IS_LONG, 0)
^
In file included from /root/src/scws/phpext/php_scws.c:186:0:
/root/src/scws/phpext/scws_arginfo.h:100:86: error: expected ‘) before numeric constant
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleCWS_send_text, 0, 1, _IS_BOOL, 0)
^
In file included from /www/server/php/80/include/php/main/php.h:35:0,
from /root/src/scws/phpext/php_scws.c:25:
/www/server/php/80/include/php/Zend/zend_API.h:122:99: error: expected identifier or ‘(’ before ‘,’ token
{ #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), NULL },
^
/root/src/scws/phpext/scws_arginfo.h:101:2: note: in expansion of macro ‘ZEND_ARG_TYPE_INFO’
ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0)
^
In file included from /root/src/scws/phpext/php_scws.c:186:0:
/root/src/scws/phpext/scws_arginfo.h:112:85: error: expected ‘)’ before numeric constant
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleCWS_has_word, 0, 1, _IS_BOOL, 0)
^
In file included from /www/server/php/80/include/php/main/php.h:35:0,
from /root/src/scws/phpext/php_scws.c:25:
/www/server/php/80/include/php/Zend/zend_API.h:122:99: error: expected identifier or ‘(’ before ‘,’ token
{ #name, ZEND_TYPE_INIT_CODE(type_hint, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)), NULL },
^
/root/src/scws/phpext/scws_arginfo.h:113:2: note: in expansion of macro ‘ZEND_ARG_TYPE_INFO’
ZEND_ARG_TYPE_INFO(0, attr, IS_STRING, 0)
^
In file included from /root/src/scws/phpext/php_scws.c:186:0:
/root/src/scws/phpext/scws_arginfo.h:120:84: error: expected ‘)’ before numeric constant
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleCWS_version, 0, 0, IS_STRING, 0)
^
In file included from /www/server/php/80/include/php/main/php.h:35:0,
from /root/src/scws/phpext/php_scws.c:25:
/root/src/scws/phpext/scws_arginfo.h:164:37: error: ‘arginfo_class_SimpleCWS_close’ undeclared here (not in a function)
ZEND_ME_MAPPING(close, scws_close, arginfo_class_SimpleCWS_close, ZEND_ACC_PUBLIC)
^
/www/server/php/80/include/php/Zend/zend_API.h:77:80: note: in definition of macro ‘ZEND_RAW_FENTRY’
#define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags) { zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
^
/root/src/scws/phpext/scws_arginfo.h:164:2: note: in expansion of macro ‘ZEND_ME_MAPPING’
ZEND_ME_MAPPING(close, scws_close, arginfo_class_SimpleCWS_close, ZEND_ACC_PUBLIC)
^
/root/src/scws/phpext/scws_arginfo.h:165:43: error: ‘arginfo_class_SimpleCWS_add_dict’ undeclared here (not in a function)
ZEND_ME_MAPPING(add_dict, scws_add_dict, arginfo_class_SimpleCWS_add_dict, ZEND_ACC_PUBLIC)
^
/www/server/php/80/include/php/Zend/zend_API.h:77:80: note: in definition of macro ‘ZEND_RAW_FENTRY’
#define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags) { zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
^
/root/src/scws/phpext/scws_arginfo.h:165:2: note: in expansion of macro ‘ZEND_ME_MAPPING’
ZEND_ME_MAPPING(add_dict, scws_add_dict, arginfo_class_SimpleCWS_add_dict, ZEND_ACC_PUBLIC)
^
/root/src/scws/phpext/scws_arginfo.h:166:49: error: ‘arginfo_class_SimpleCWS_set_charset’ undeclared here (not in a function)
ZEND_ME_MAPPING(set_charset, scws_set_charset, arginfo_class_SimpleCWS_set_charset, ZEND_ACC_PUBLIC)
^
/www/server/php/80/include/php/Zend/zend_API.h:77:80: note: in definition of macro ‘ZEND_RAW_FENTRY’
#define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags) { zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
^
/root/src/scws/phpext/scws_arginfo.h:166:2: note: in expansion of macro ‘ZEND_ME_MAPPING’
ZEND_ME_MAPPING(set_charset, scws_set_charset, arginfo_class_SimpleCWS_set_charset, ZEND_ACC_PUBLIC)
^
/root/src/scws/phpext/scws_arginfo.h:168:43: error: ‘arginfo_class_SimpleCWS_set_rule’ undeclared here (not in a function)
ZEND_ME_MAPPING(set_rule, scws_set_rule, arginfo_class_SimpleCWS_set_rule, ZEND_ACC_PUBLIC)
^
/www/server/php/80/include/php/Zend/zend_API.h:77:80: note: in definition of macro ‘ZEND_RAW_FENTRY’
#define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags) { zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
^
/root/src/scws/phpext/scws_arginfo.h:168:2: note: in expansion of macro ‘ZEND_ME_MAPPING’
ZEND_ME_MAPPING(set_rule, scws_set_rule, arginfo_class_SimpleCWS_set_rule, ZEND_ACC_PUBLIC)
^
/root/src/scws/phpext/scws_arginfo.h:169:47: error: ‘arginfo_class_SimpleCWS_set_ignore’ undeclared here (not in a function)
ZEND_ME_MAPPING(set_ignore, scws_set_ignore, arginfo_class_SimpleCWS_set_ignore, ZEND_ACC_PUBLIC)
^
/www/server/php/80/include/php/Zend/zend_API.h:77:80: note: in definition of macro ‘ZEND_RAW_FENTRY’
#define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags) { zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
^
/root/src/scws/phpext/scws_arginfo.h:169:2: note: in expansion of macro ‘ZEND_ME_MAPPING’
ZEND_ME_MAPPING(set_ignore, scws_set_ignore, arginfo_class_SimpleCWS_set_ignore, ZEND_ACC_PUBLIC)
^
/root/src/scws/phpext/scws_arginfo.h:170:45: error: ‘arginfo_class_SimpleCWS_set_multi’ undeclared here (not in a function)
ZEND_ME_MAPPING(set_multi, scws_set_multi, arginfo_class_SimpleCWS_set_multi, ZEND_ACC_PUBLIC)
^
/www/server/php/80/include/php/Zend/zend_API.h:77:80: note: in definition of macro ‘ZEND_RAW_FENTRY’
#define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags) { zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
^
/root/src/scws/phpext/scws_arginfo.h:170:2: note: in expansion of macro ‘ZEND_ME_MAPPING’
ZEND_ME_MAPPING(set_multi, scws_set_multi, arginfo_class_SimpleCWS_set_multi, ZEND_ACC_PUBLIC)
^
/root/src/scws/phpext/scws_arginfo.h:172:45: error: ‘arginfo_class_SimpleCWS_send_text’ undeclared here (not in a function)
ZEND_ME_MAPPING(send_text, scws_send_text, arginfo_class_SimpleCWS_send_text, ZEND_ACC_PUBLIC)
^
/www/server/php/80/include/php/Zend/zend_API.h:77:80: note: in definition of macro ‘ZEND_RAW_FENTRY’
#define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags) { zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
^
/root/src/scws/phpext/scws_arginfo.h:172:2: note: in expansion of macro ‘ZEND_ME_MAPPING’
ZEND_ME_MAPPING(send_text, scws_send_text, arginfo_class_SimpleCWS_send_text, ZEND_ACC_PUBLIC)
^
/root/src/scws/phpext/scws_arginfo.h:175:43: error: ‘arginfo_class_SimpleCWS_has_word’ undeclared here (not in a function)
ZEND_ME_MAPPING(has_word, scws_has_word, arginfo_class_SimpleCWS_has_word, ZEND_ACC_PUBLIC)
^
/www/server/php/80/include/php/Zend/zend_API.h:77:80: note: in definition of macro ‘ZEND_RAW_FENTRY’
#define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags) { zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
^
/root/src/scws/phpext/scws_arginfo.h:175:2: note: in expansion of macro ‘ZEND_ME_MAPPING’
ZEND_ME_MAPPING(has_word, scws_has_word, arginfo_class_SimpleCWS_has_word, ZEND_ACC_PUBLIC)
^
/root/src/scws/phpext/scws_arginfo.h:177:41: error: ‘arginfo_class_SimpleCWS_version’ undeclared here (not in a function)
ZEND_ME_MAPPING(version, scws_version, arginfo_class_SimpleCWS_version, ZEND_ACC_PUBLIC)
^
/www/server/php/80/include/php/Zend/zend_API.h:77:80: note: in definition of macro ‘ZEND_RAW_FENTRY’
#define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags) { zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
^
/root/src/scws/phpext/scws_arginfo.h:177:2: note: in expansion of macro ‘ZEND_ME_MAPPING’
ZEND_ME_MAPPING(version, scws_version, arginfo_class_SimpleCWS_version, ZEND_ACC_PUBLIC)

这样要怎么解决呢?

@hightman ,您好,感谢回答
/www/server/panel/php/80/phpize
./configure --with-php-config=/www/server/panel/php/80/php-config --with-scws=/usr/local/scws
make
这时间报这个错,是用的php8.0的phpize和php-config
我试了下php8.2可以编译成功,但是我们的老系统不兼容php8.2

重新clone应该就可以了,原因是 php 从 8.1 才开始引入 arginfo。