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
In general clang2py does not like the headers I give it.
I was trying to use cffi on some headers and it did not them either.
The following made them more palatable, and clang2py likes headers resulting from this as well:
result = subprocess.check_output(f"clang -E -I. {header}", shell=True)
sanitized = []
for line in result.decode(encoding='utf-8').split('\n'):
for bad in ['__asm__', '__attribute__']:
if bad in line:
line = f'{line.split(bad)[0]};'.replace(';;',';')
sanitized.append(line)
lines = "\n".join(sanitized)
With sanitized headers and the above sed commands I'm having a lot more success with ctypeslib than I was having with cffi
I'm passing in my library and getting most symbols resolved by it.
When I try to pass in libc.so.6 as well, I get no output from clang2py, but that is a different issue.
Since that is a python keyword, loading the resulting file is problematic....
I was able to fix and a few other issues with:
The text was updated successfully, but these errors were encountered: