X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Flib%2Fstatic.qh;h=e1cfeb8721ce54f6b29a9f440e410d2c29bf5626;hb=537313c9e52ce93b28ad6580b76e92d99f0a9d93;hp=f7bcdcc296688e5ac8303a424284544561147e16;hpb=948c08402a7b9b7af36059104937650e343ecefe;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/static.qh b/qcsrc/lib/static.qh index f7bcdcc29..e1cfeb872 100644 --- a/qcsrc/lib/static.qh +++ b/qcsrc/lib/static.qh @@ -1,19 +1,20 @@ -#ifndef STATIC_H -#define STATIC_H +#pragma once -void __static_init() { } +void __static_init() {} #define static_init() CALL_ACCUMULATED_FUNCTION(__static_init) -void __static_init_late() { } +void __static_init_late() {} #define static_init_late() CALL_ACCUMULATED_FUNCTION(__static_init_late) - -#define REGISTER_REGISTRY(func) ACCUMULATE_FUNCTION(__static_init, func) +void __static_init_precache() {} +#define static_init_precache() CALL_ACCUMULATED_FUNCTION(__static_init_precache) +void __shutdown() {} +#define shutdownhooks() CALL_ACCUMULATED_FUNCTION(__shutdown) #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) + void _static_##func(); \ + ACCUMULATE_FUNCTION(where, _static_##func) \ + void _static_##func() -#endif +#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) +#define SHUTDOWN(func) _STATIC_INIT(__shutdown, func##_shutdown)