summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-06-30 16:09:23 -0400
committerJakob Kaivo <jkk@ung.org>2020-06-30 16:09:23 -0400
commit388f3dfd269368b26990f86d12ea6ab1c4b7c4e6 (patch)
treedc662d2cc8bd2da650bf3554764ab8534c2d1442 /include
parent30779981519a03506e515851a760a1f1f5a98a23 (diff)
add optional macros to directly provide the <stdlib.h> interface
Diffstat (limited to 'include')
-rw-r--r--include/mapalloc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/mapalloc.h b/include/mapalloc.h
index 65581c8..1c43f2b 100644
--- a/include/mapalloc.h
+++ b/include/mapalloc.h
@@ -9,9 +9,16 @@ void *MA_realloc(void *ptr, size_t n);
void MA_free(void *ptr);
#ifdef MA_OVERRIDE_STDLIB
+#undef malloc
#define malloc(n) MA_malloc(n)
+
+#undef calloc
#define calloc(n, e) MA_calloc(n, e)
+
+#undef realloc
#define realloc(p, n) MA_realloc(p, n)
+
+#undef free
#define free(p) MA_free(p)
#endif