Skip to content

Add support for offsetof expression

Val Och requested to merge v19930312/vala:offsetof into main

Fixes #1317. Extensive tests are provided, including cases that should cause failure.

Introduces an offsetof expression that behaves just like it does in C:

struct MyStruct {
    uint8 field1;
    float field2;
}

offsetof(MyStruct, field1);
offsetof(MyStruct, field2);

Works on structs and, as much as possible, on classes.

Edited by Val Och

Merge request reports