Skip to content

Struct support

username-removed-67780 requested to merge TimePath/structs into master

Example:

#define STRUCT_PAIR(_, my) \
    _(my, first, float, ) \
    _(my, second, float, END) // END is required
STRUCT(PAIR, STRUCT_PAIR)

STRUCT_DECLARE(last, STRUCT_PAIR) // no semicolon because gmqcc won't allow it

void test(STRUCT_PARAM(in, STRUCT_PAIR)) {
    STRUCT_DECLARE(local, STRUCT_PAIR);
    local_first = in_second;
    local_second = in_first;
    STRUCT_STORE(local, last, STRUCT_PAIR); // local goes to last
    next(STRUCT_PASS(local, STRUCT_PAIR));
}

Merge request reports