7 #define REGISTER_INIT(ns, id) [[accumulate]] void Register_##ns##_##id##_init(entity this)
8 #define REGISTER_INIT_POST(ns, id) [[accumulate]] void Register_##ns##_##id##_init_post(entity this)
10 #define REGISTER(initfunc, ns, array, counter, id, fld, inst) \
12 REGISTER_INIT(ns, id) { } \
13 REGISTER_INIT_POST(ns, id) { } \
14 .entity enemy; /* internal next pointer */ \
15 void Register_##ns##_##id() { \
19 array[counter++] = this; \
20 if (!array##_first) array##_first = this; \
21 if ( array##_last) array##_last.enemy = this; \
22 array##_last = this; \
23 Register_##ns##_##id##_init(this); \
24 Register_##ns##_##id##_init_post(this); \
26 ACCUMULATE_FUNCTION(initfunc, Register_##ns##_##id) \
29 void __static_init() { }
30 #define static_init() CALL_ACCUMULATED_FUNCTION(__static_init)
31 #define REGISTER_REGISTRY(func) ACCUMULATE_FUNCTION(__static_init, func)
33 #define STATIC_INIT(func) \
34 void _static_##func(); \
35 ACCUMULATE_FUNCTION(__static_init, _static_##func) \