diff --git a/lib/StubGen/Converter.py b/lib/StubGen/Converter.py index 2043240..ffe4c6c 100644 --- a/lib/StubGen/Converter.py +++ b/lib/StubGen/Converter.py @@ -22,24 +22,6 @@ _RE_LINE_COMMENT: re.Pattern[str] = re.compile(r'#.*$') _STUB_TYPE_ALIASES: dict[str, str] = { 'CPtr': 'rawptr', 'CArrayPtr': 'rawptr', 'CAutoPtr': 'rawptr', 'CRef': 'rawptr', 'CTempRef': 'rawptr', - 'CInt': 'int', 'CChar': 'char', 'CBool': 'bool', 'CVoid': 'void', - 'CFloat': 'float', 'CDouble': 'double', - 'CUnsignedChar': 'uchar', 'CUnsignedShort': 'ushort', 'CUnsignedInt': 'uint', - 'CUnsignedLong': 'ulong', 'CUnsignedLongLong': 'ulonglong', - 'CSignedChar': 'int8', 'CShort': 'short', 'CLong': 'long', 'CLongLong': 'longlong', - 'CSizeT': 'sizet', 'CIntPtrT': 'int64', 'CUIntPtrT': 'uint64', 'CPtrDiffT': 'ptrdifft', - 'CInt8T': 'int8', 'CInt16T': 'int16', 'CInt32T': 'int32', 'CInt64T': 'int64', - 'CUInt8T': 'uint8', 'CUInt16T': 'uint16', 'CUInt32T': 'uint32', 'CUInt64T': 'uint64', - 'CIntFast8T': 'intfast8', 'CIntFast16T': 'intfast16', - 'CIntFast32T': 'intfast32', 'CIntFast64T': 'intfast64', - 'CUIntFast8T': 'uintfast8', 'CUIntFast16T': 'uintfast16', - 'CUIntFast32T': 'uintfast32', 'CUIntFast64T': 'uintfast64', - 'CIntLeast8T': 'intleast8', 'CIntLeast16T': 'intleast16', - 'CIntLeast32T': 'intleast32', 'CIntLeast64T': 'intleast64', - 'CUIntLeast8T': 'uintleast8', 'CUIntLeast16T': 'uintleast16', - 'CUIntLeast32T': 'uintleast32', 'CUIntLeast64T': 'uintleast64', - 'CConst': 'const', 'CVolatile': 'volatile', 'CStatic': 'static', - 'CExport': 'export', 'CExtern': 'extern', 'CInline': 'inline', } diff --git a/lib/core/TypeAnnotationResolver.py b/lib/core/TypeAnnotationResolver.py index c0abfe0..ed7aaa9 100644 --- a/lib/core/TypeAnnotationResolver.py +++ b/lib/core/TypeAnnotationResolver.py @@ -452,6 +452,11 @@ class TypeAnnotationResolver: 不再静默退化为 %"{mod}.{名}"* 假结构体(下游仅报 "Type of #N arg mismatch: %…* != …",无法归因到 typedef 声明)。 """ + AliasClass: type | None = TypeSystem.BUILTIN_TYPE_ALIASES.get(TypeName) + if AliasClass is not None: + Info: CTypeInfo = CTypeInfo() + Info.BaseType = AliasClass + return Info if not TypeName: return None if TypeName == cls._BUILTIN_ROWPTR_NAME: