4 #define REGISTER_INIT(ns, id) [[accumulate]] void Register_##ns##_##id##_init(entity this)
6 #define REGISTER(initfunc, ns, array, counter, id, class, fld) \
8 REGISTER_INIT(ns, id) { } \
9 void Register_##ns##_##id() { \
10 entity this = NEW(class); \
13 array[counter++] = this; \
14 Register_##ns##_##id##_init(this); \
16 ACCUMULATE_FUNCTION(initfunc, Register_##ns##_##id) \
19 void __static_init() { }
20 #define static_init() CALL_ACCUMULATED_FUNCTION(__static_init)
21 #define REGISTER_REGISTRY(func) ACCUMULATE_FUNCTION(__static_init, func)