Code formatting
This commit is contained in:
8
haxcc.h
8
haxcc.h
@@ -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);
|
||||
|
||||
5
haxcc.ld
5
haxcc.ld
@@ -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 = .);
|
||||
|
||||
@@ -5,7 +5,7 @@ project(
|
||||
default_options : [
|
||||
'warning_level=3',
|
||||
'c_std=c2x',
|
||||
'cpp_std=c++23'
|
||||
'cpp_std=c++20'
|
||||
])
|
||||
|
||||
ldscript = 'haxcc.ld'
|
||||
|
||||
Reference in New Issue
Block a user