aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Moon Flower <moon@coffin.ir> 2025-02-26 12:34:00 +0330
committerGravatar Moon Flower <moon@coffin.ir> 2025-02-26 12:34:00 +0330
commitf68447b1e469efff04647a0e20952144d95f27d7 (patch)
tree57212db127c6e0da841525ea721f76b0004547af
parentfixed main.c (diff)
main.m4 -> moonshine.m4
-rw-r--r--Makefile2
-rw-r--r--main.c6
-rw-r--r--moonshine.m4 (renamed from main.m4)0
3 files changed, 4 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 323ab9e..b73f7a6 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ SIZE_FLAGS = -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -s -fno-u
all: m4 c test
m4:
- m4 main.m4 > moonshine.m4.h
+ m4 moonshine.m4 > moonshine.m4.h
c:
clang main.c -o out.bin $(FLAGS) -O3
diff --git a/main.c b/main.c
index 0550dc1..de8da5c 100644
--- a/main.c
+++ b/main.c
@@ -7,12 +7,12 @@ void cleanup_free(var* input) { print("Deallocation logic goes here ", input); }
#define auto_free __attribute__((cleanup(cleanup_free)))
-#define create(name, ...) \
+#define create(type, name, ...) \
auto_free var cat(name, _parent) = __VA_ARGS__; \
- auto name = cat(name, _parent);
+ type name = cat(name, _parent);
int main() {
- create(proof_of_concept, new(int));
+ create(t(int), proof_of_concept, new(int));
print("Neat, right? ", proof_of_concept);
diff --git a/main.m4 b/moonshine.m4
index 8b88120..8b88120 100644
--- a/main.m4
+++ b/moonshine.m4