Open VarLad opened 2 months ago
Could you share the C example code?
typedef struct WGPUChainedStruct {
struct WGPUChainedStruct const * next;
WGPUSType sType;
} WGPUChainedStruct WGPU_STRUCTURE_ATTRIBUTE;
typedef struct WGPUBufferDescriptor {
WGPUChainedStruct const * nextInChain;
WGPU_NULLABLE char const * label;
WGPUBufferUsageFlags usage;
uint64_t size;
WGPUBool mappedAtCreation;
} WGPUBufferDescriptor WGPU_STRUCTURE_ATTRIBUTE;
@Gnimuc I believe we've to edit mutability.jl for StructForwardDecl
, TypedefFunction
and UnionForwardDecl
? Does the current code allow this? (I saw it was just checking the nodes, so, can it work if we just edit https://github.com/JuliaInterop/Clang.jl/blob/master/src/generator/mutability.jl#L38 to include the above types to be checked?)
This is the current rule which is used to workaround the following case:
You can add more reasonable rules to should_tweak
or directly in the pass function.
struct B x::Ptr{B} y::D end
wait. does it only happen to StructMutualRef
?
What happens if you remove StructMutualRef
in this line?
This actually do check those StructMutualRef
types..
I think we need to add new rules for non-function-proto types.
There are a few structs which take a pointer to another struct as one of its fields. For example, in a certain generated code:
In such cases, wouldn't it make more sense if
B
was mutable, and forauto_mutability
to makeB
mutable as well?