well-typed / hs-bindgen

Automatically generate Haskell bindings from C header files
20 stars 0 forks source link

StructField should include an offset #133

Closed phadej closed 1 month ago

phadej commented 2 months ago

... even if we don't yet support bitnarrowed fields. See #132

struct S4 {
    char b;
    int a;
};
      DeclStruct
        Struct {
          structTag = Just "S4",
          structSizeof = 8,
          structAlignment = 4,
          structFields = [
            StructField {
              fieldName = "b",
              fieldType = PrimChar},
            StructField {
              fieldName = "a",
              fieldType = PrimInt}]}])

the total size is 8 not 1+4=5.