Code formatting

This commit is contained in:
2025-04-04 22:06:22 +02:00
parent 389eecfd73
commit e3497e315c
3 changed files with 13 additions and 4 deletions

View File

@@ -12,8 +12,14 @@ typedef struct mod {
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))))
static const struct mod name \
__attribute__(( \
used, \
section("__haxmod"), \
aligned(__alignof__(struct mod)) \
))
mod* mod_begin(void);
mod* mod_end(void);

View File

@@ -1,6 +1,9 @@
SECTIONS
{
haxmods (READONLY) : ALIGN(4) {
/**
* Define a custom section named 'haxmods' that is marked as READONLY.
*/
haxmods (READONLY) : {
PROVIDE(haxmods_begin = .);
KEEP(*(__haxmod))
PROVIDE(haxmods_end = .);

View File

@@ -5,7 +5,7 @@ project(
default_options : [
'warning_level=3',
'c_std=c2x',
'cpp_std=c++23'
'cpp_std=c++20'
])
ldscript = 'haxcc.ld'