diff options
| author | Mel <mel@rnrd.eu> | 2026-01-22 18:27:28 +0100 |
|---|---|---|
| committer | Mel <mel@rnrd.eu> | 2026-01-22 19:12:20 +0100 |
| commit | fce4a99dbfab5af623bb05d9e10807efeced5a47 (patch) | |
| tree | 791fd7b45ac2a44b5878e41448aa048c66ae4732 /boot/common.c | |
| parent | 7f5d765c929a4dc2deddb7b68a41a3a841940837 (diff) | |
| download | catskill-fce4a99dbfab5af623bb05d9e10807efeced5a47.tar.zst catskill-fce4a99dbfab5af623bb05d9e10807efeced5a47.zip | |
Implement file embedding into compiler sources during build
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/common.c')
| -rw-r--r-- | boot/common.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/boot/common.c b/boot/common.c index 095aaa6..79f5d63 100644 --- a/boot/common.c +++ b/boot/common.c @@ -48,6 +48,13 @@ #define NORETURN _Noreturn +// macro used as target for embedding binary files during build into a byte array. +// usage: `const byte test_data[] = CATSKILL_EMBED(./files/test_data.txt);` +// the array will be filled with hexadecimal values of the file contents, +// with a nil byte appended at the end. +// the size of the array can be retrieved through `strlen(array)`, or `ARRAY_SIZE(array)-1`. +#define CATSKILL_EMBED(...) {0} + // ansi escape codes for terminal color and style #define ANSI(code) "\33[" code "m" |
