aboutsummaryrefslogtreecommitdiff
path: root/macro.h
diff options
context:
space:
mode:
Diffstat (limited to 'macro.h')
-rw-r--r--macro.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/macro.h b/macro.h
new file mode 100644
index 00000000..c4b3fc9b
--- /dev/null
+++ b/macro.h
@@ -0,0 +1,10 @@
+#ifndef MACRO_H
+#define MACRO_H
+
+#define TP(a, b) a ## b
+
+#define NEW(T, N, ...) \
+ T* N = malloc(sizeof(*N)); \
+ TP(T, _init) (N, __VA_ARGS__);
+
+#endif /* MACRO_H */