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

Support for `using` #430

Closed vchuravy closed 5 months ago

vchuravy commented 1 year ago
/// These callbacks are used to return multiple types from functions while
/// transferring ownership to the caller. The first argument is the number of
/// consecutive elements pointed to by the second argument. The third argument
/// is an opaque pointer forwarded to the callback by the caller.
using MlirTypesCallback = void (*)(intptr_t, MlirType *, void *);

Lead to:

/home/vchuravy/.julia/artifacts/c90711842814121dacf839a59bca4c40f573cbff/include/mlir-c/Interfaces.h:51:1: error: unknown type name 'using'
/home/vchuravy/.julia/artifacts/c90711842814121dacf839a59bca4c40f573cbff/include/mlir-c/Interfaces.h:51:27: error: expected expression
/home/vchuravy/.julia/artifacts/c90711842814121dacf839a59bca4c40f573cbff/include/mlir-c/Interfaces.h:60:45: error: unknown type name 'MlirTypesCallback'
Gnimuc commented 1 year ago

using MlirTypesCallback = void (*)(intptr_t, MlirType *, void *);

this is actually C++, C doesn't have the using keyword.

vchuravy commented 1 year ago

I see I will need to grumble at upstream for putting that into a C header

vchuravy commented 1 year ago

Is there a way to work around this in Clang.jl?

Gnimuc commented 5 months ago

closed by #480, #432, #435