Initial commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#ifndef CCHAX_MOD_H
|
||||
#define CCHAX_MOD_H
|
||||
|
||||
typedef int (*fn_t)(void);
|
||||
|
||||
typedef struct mod_t {
|
||||
char const* name;
|
||||
fn_t fn;
|
||||
} mod_t;
|
||||
|
||||
#define mod_register(name_ref, fn_ref) \
|
||||
static struct mod_t mod_##name_ref __attribute__(( \
|
||||
used, \
|
||||
section("__mod_list"), \
|
||||
aligned(__alignof__(struct mod_t)) \
|
||||
)) = { \
|
||||
.name = #name_ref, \
|
||||
.fn = fn_ref \
|
||||
}
|
||||
|
||||
void run_mods(void);
|
||||
|
||||
#endif // !CCHAX_MOD_H
|
||||
Reference in New Issue
Block a user