summaryrefslogtreecommitdiff
path: root/app/cornu/zmisc.h
diff options
context:
space:
mode:
Diffstat (limited to 'app/cornu/zmisc.h')
-rw-r--r--app/cornu/zmisc.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/cornu/zmisc.h b/app/cornu/zmisc.h
new file mode 100644
index 0000000..ce3d4d3
--- /dev/null
+++ b/app/cornu/zmisc.h
@@ -0,0 +1,12 @@
+/**
+ * Misc portability and convenience macros.
+ **/
+
+#include <stdlib.h>
+
+#define zalloc malloc
+#define zrealloc realloc
+#define zfree free
+
+#define znew(type, n) (type *)zalloc(sizeof(type) * (n))
+#define zrenew(type, p, n) (type *)zrealloc((p), sizeof(type) * (n))