]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commit
Merge branch 'TimePath/structs' into 'master'
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 27 Aug 2015 07:28:28 +0000 (07:28 +0000)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 27 Aug 2015 07:28:28 +0000 (07:28 +0000)
commit89b0810f80f6fc223d0ab779da6c897b72b6e678
treee47143876a0fd523433365cb5488f9e12b25cfa4
parent15218c58cd7fc3878715aa71b8358a0ea0585638
parent94c11346f2f4f0ba132f003a62da6395a09d7c6a
Merge branch 'TimePath/structs' into 'master'

Struct support

Example:

```c
#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));
}
```

See merge request !183