Files
haxcc/haxcc.h
2025-04-04 22:06:22 +02:00

28 lines
847 B
C

#ifndef HAXCC_H
#define HAXCC_H
typedef int (*init_fn)(void);
typedef int (*done_fn)(void);
typedef struct mod {
char const* name;
int priority;
init_fn init;
done_fn done;
} mod;
// Define a macro to place a 'mod' struct into a special section called '__haxmod'
#define HAX_MOD(name) \
static const struct mod name \
__attribute__(( \
used, \
section("__haxmod"), \
aligned(__alignof__(struct mod)) \
))
mod* mod_begin(void);
mod* mod_end(void);
#endif // HAXCC_H