尝试进行 Qt 测试,增加了 AI 人机调试工具 _console,以及 TransPyV 进行修正
This commit is contained in:
@@ -254,7 +254,7 @@ class DeclarationGenerator:
|
||||
"""解析基类名称的类型种类(支持别名)
|
||||
|
||||
Returns:
|
||||
'enum' | 'union' | 'renum' | 'struct' | None
|
||||
'enum' | 'union' | 'renum' | 'struct' | 'ctype_marker' | None
|
||||
"""
|
||||
# 1) 查 t 别名映射(from t import CEnum as en)
|
||||
if base_name in self._t_alias_map:
|
||||
@@ -265,6 +265,10 @@ class DeclarationGenerator:
|
||||
return 'union'
|
||||
if issubclass(t_cls, t.CStruct):
|
||||
return 'struct'
|
||||
# CType 及其子类(CChar/CInt/CVoid/CPtr 等)是"类型强转"标记,
|
||||
# 不应被编译为真实结构体,也不应被生成 stub 声明。
|
||||
if issubclass(t_cls, t.CType):
|
||||
return 'ctype_marker'
|
||||
|
||||
# 2) 直接查 t 模块属性
|
||||
t_cls: type | None = getattr(t, base_name, None)
|
||||
@@ -275,6 +279,8 @@ class DeclarationGenerator:
|
||||
return 'union'
|
||||
if issubclass(t_cls, t.CStruct):
|
||||
return 'struct'
|
||||
# CType 及其子类是"类型强转"标记,不编译为结构体。
|
||||
return 'ctype_marker'
|
||||
|
||||
return None
|
||||
|
||||
@@ -313,6 +319,10 @@ class DeclarationGenerator:
|
||||
is_union = True
|
||||
elif kind == 'renum':
|
||||
is_renum = True
|
||||
elif kind == 'ctype_marker':
|
||||
# CType 及其子类(CChar/CInt/CVoid/CPtr/CTypeDefault 等)是
|
||||
# "类型强转"标记,不应被编译为真实结构体,也不生成 stub 声明。
|
||||
return decls
|
||||
if is_exception:
|
||||
return decls
|
||||
if is_enum:
|
||||
|
||||
Reference in New Issue
Block a user