6 #define REGISTER_INIT(ns, id) [[accumulate]] void Register_##ns##_##id##_init(entity this)
8 #define REGISTER(initfunc, ns, array, counter, id, class, fld) \
10 REGISTER_INIT(ns, id) { } \
11 .entity enemy; /* internal next pointer */ \
12 void Register_##ns##_##id() { \
13 entity this = NEW(class); \
16 array[counter++] = this; \
17 if (!array##_first) array##_first = this; \
18 if ( array##_last) array##_last.enemy = this; \
19 array##_last = this; \
20 Register_##ns##_##id##_init(this); \
22 ACCUMULATE_FUNCTION(initfunc, Register_##ns##_##id) \
25 void __static_init() { }
26 #define static_init() CALL_ACCUMULATED_FUNCTION(__static_init)
27 #define REGISTER_REGISTRY(func) ACCUMULATE_FUNCTION(__static_init, func)
29 #define STATIC_INIT(func) \
30 void _static_##func(); \
31 ACCUMULATE_FUNCTION(__static_init, _static_##func) \