diff --git a/lib/core/Handles/HandlesImports.py b/lib/core/Handles/HandlesImports.py index fd14f7e..74fd7bb 100644 --- a/lib/core/Handles/HandlesImports.py +++ b/lib/core/Handles/HandlesImports.py @@ -1398,7 +1398,13 @@ class ImportHandle(BaseHandle): # 检查是否是 CDefine 常量或 CTypedef 类型别名 IsCDefine = False IsCTypedef = False - if isinstance(Node.annotation, ast.Name): + _GlobalMarkers: tuple[str, ...] = (tuple(getattr(Node, 'Markers', None) or ()) + + tuple(getattr(Node.annotation, 'Markers', None) or ())) + if 'define' in _GlobalMarkers: + IsCDefine = True + elif 'typedef' in _GlobalMarkers: + IsCTypedef = True + elif isinstance(Node.annotation, ast.Name): if Node.annotation.id == 'CDefine': IsCDefine = True elif Node.annotation.id == 'CTypedef':