JuliaInterop/Clang.jl

`UndefVarError` when encountering `#define` used to rename function

topolarity opened this issue · 1 comments

It's not uncommon for C libraries to use #define to rename a function:

// test.h
#define fprintf sh_fprintf

but this will generate an invalid const definition:

module TestModule

const fprintf = sh_fprintf

end # module

It seems like Clang.jl needs to keep track of the identifiers here maybe?

agreed. maybe LLMs can do better.