CppAst.CodeGen icon indicating copy to clipboard operation
CppAst.CodeGen copied to clipboard

Fixed sized buffers of typedefs to primitives seem to generate incorrectly

Open waldnercharles opened this issue 3 years ago • 0 comments

A fixed size buffer of a typedef of a primitive generates improperly:

C

typedef uint64_t ecs_id_t;
typedef struct ecs_bulk_desc_t {
    ecs_id_t ids[32]; 
}

C#

public readonly partial struct ecs_id_t : IEquatable<ecs_id_t> { ... }
public unsafe partial struct ecs_bulk_desc_t
{
    public fixed IEquatable<ecs_id_t> ids[32];
}

The code path being hit that generates this is https://github.com/xoofx/CppAst.CodeGen/blob/master/src/CppAst.CodeGen/CSharp/Plugins/DefaultTypeConverter.cs#L177

Not sure what the correct way to resolve this is.

waldnercharles avatar Mar 25 '22 21:03 waldnercharles