You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's because that clang_getClangVersion interface return type is not c_char_p but CXString. Below is my modify:
class CXString(ctypes.Structure):
_fields_ = [
('data', ctypes.POINTER(None)),
('private_flags', ctypes.c_uint32),
]
def clang_version():
"""Pull the clang C library version from the API"""
# avoid loading the cindex API (cindex.conf.lib) to avoid version conflicts
get_version = cindex.conf.get_cindex_library().clang_getClangVersion
get_version.restype = CXString
version_string = get_version()
version_string = ctypes.cast(version_string.data, ctypes.c_char_p).value
version = 'Unknown'
if version_string and len(version_string) > 0:
version_groups = re.match(br'.+version ((\d+\.)?(\d+\.)?(\*|\d+))', version_string)
if version_groups and len(version_groups.groups()) > 0:
version = version_groups.group(1).decode()
return version
The text was updated successfully, but these errors were encountered:
huhutm
changed the title
solve windows clang-157.0.6 get_version() access violation exception
solve windows clang-17.0.6 get_version() access violation exception
Jul 18, 2024
It's because that clang_getClangVersion interface return type is not c_char_p but CXString. Below is my modify:
The text was updated successfully, but these errors were encountered: