#ifndef STATIC_H #define STATIC_H void __static_init() {} #define static_init() CALL_ACCUMULATED_FUNCTION(__static_init) void __static_init_late() {} #define static_init_late() CALL_ACCUMULATED_FUNCTION(__static_init_late) void __static_init_precache() {} #define static_init_precache() CALL_ACCUMULATED_FUNCTION(__static_init_precache) #define _STATIC_INIT(where, func) \ void _static_##func(); \ ACCUMULATE_FUNCTION(where, _static_##func) \ void _static_##func() #define STATIC_INIT(func) _STATIC_INIT(__static_init, func) #define STATIC_INIT_LATE(func) _STATIC_INIT(__static_init_late, func##_late) #define PRECACHE(func) _STATIC_INIT(__static_init_precache, func##_precache) #endif