mozilla / cbindgen

A project for generating C bindings from Rust code
Mozilla Public License 2.0
2.29k stars 294 forks source link

CamelCase style union tag. #890

Closed cathaysia closed 5 months ago

cathaysia commented 9 months ago

cbindgen will generate SnakeCase style tag for union currently, if it's possible generate CamelCase tag?

such as if we have:

typedef enum Foo_Tag {
  A,
} Foo_Tag;

typedef struct Foo {
  Foo_Tag tag;
  union {
    struct {
      float a[20];
    };
  };
} Foo;

void root(struct Foo a);

I hope it can be:

typedef enum FooTag {
  A,
} FooTag;

typedef struct Foo {
  FooTag tag;
  union {
    struct {
      float a[20];
    };
  };
} Foo;

void root(struct Foo a);