From e3497e315c05e2532a65fd6fff2a076e7fcfcbdf Mon Sep 17 00:00:00 2001 From: mononerv Date: Fri, 4 Apr 2025 22:06:22 +0200 Subject: [PATCH] Code formatting --- haxcc.h | 10 ++++++++-- haxcc.ld | 5 ++++- meson.build | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/haxcc.h b/haxcc.h index 5ca5c5e..4e0b6a2 100644 --- a/haxcc.h +++ b/haxcc.h @@ -12,8 +12,14 @@ typedef struct mod { done_fn done; } mod; -#define HAX_MOD(name) \ - static const struct mod name __attribute__((used, section("__haxmod"), aligned(__alignof__(struct 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); diff --git a/haxcc.ld b/haxcc.ld index 0c9c443..0d8db1c 100644 --- a/haxcc.ld +++ b/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 = .); diff --git a/meson.build b/meson.build index 5f9c761..26306fd 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project( default_options : [ 'warning_level=3', 'c_std=c2x', - 'cpp_std=c++23' + 'cpp_std=c++20' ]) ldscript = 'haxcc.ld'