JuliaInterop / Clang.jl

C binding generator and Julia interface to libclang
https://juliainterop.github.io/Clang.jl/
MIT License
219 stars 68 forks source link

`__restrict not defined` Error #400

Closed JBlaschke closed 1 year ago

JBlaschke commented 1 year ago

While trying to generate C-bindings for Hwloc_jll I get the following error:

ERROR: LoadError: UndefVarError: __restrict not defined

Looking at the generated code, the error is being thrown by:

const __hwloc_restrict = __restrict

Should this be ignored by the code generator (it looks like it might be getting confused by restrict, __restrict, and __restrict__)?

Gnimuc commented 1 year ago

Basically, if you don't need that symbol(__hwloc_restrict), you could workaround this by adding it in the output_ignorelist.

Should this be ignored by the code generator (it looks like it might be getting confused by restrict, __restrict, and __restrict__)?

Yes. I'm currently expanding this list case by case.

Gnimuc commented 1 year ago

Fixed by https://github.com/JuliaInterop/Clang.jl/commit/e3a60ee91b10211ce017c0e39b11ac3eae82f7ca .

JBlaschke commented 1 year ago

Brilliant ! Thanks @Gnimuc