]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/lib/static.qh
Merge branch 'terencehill/bot_fixes' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / static.qh
1 #ifndef STATIC_H
2 #define STATIC_H
3
4 void __static_init_early() { }
5 void __static_init() { CALL_ACCUMULATED_FUNCTION(__static_init_early); }
6 #define static_init() CALL_ACCUMULATED_FUNCTION(__static_init)
7 #define REGISTER_REGISTRY(func) ACCUMULATE_FUNCTION(__static_init_early, func)
8
9 #define _STATIC_INIT(where, func) \
10     void _static_##func(); \
11     ACCUMULATE_FUNCTION(where, _static_##func) \
12     void _static_##func()
13
14 #define STATIC_INIT(func)       _STATIC_INIT(__static_init_early,   func##_early)
15 #define STATIC_INIT_LATE(func)  _STATIC_INIT(__static_init,         func)
16
17 #endif