aboutsummaryrefslogtreecommitdiffstats
path: root/libs/nanopb/tests/common/malloc_wrappers_syshdr.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/nanopb/tests/common/malloc_wrappers_syshdr.h')
-rw-r--r--libs/nanopb/tests/common/malloc_wrappers_syshdr.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/nanopb/tests/common/malloc_wrappers_syshdr.h b/libs/nanopb/tests/common/malloc_wrappers_syshdr.h
new file mode 100644
index 00000000..d295d9ed
--- /dev/null
+++ b/libs/nanopb/tests/common/malloc_wrappers_syshdr.h
@@ -0,0 +1,15 @@
+/* This is just a wrapper in order to get our own malloc wrappers into nanopb core. */
+
+#define pb_realloc(ptr,size) counting_realloc(ptr,size)
+#define pb_free(ptr) counting_free(ptr)
+
+#ifdef PB_OLD_SYSHDR
+#include PB_OLD_SYSHDR
+#else
+#include <stdint.h>
+#include <stddef.h>
+#include <stdbool.h>
+#include <string.h>
+#endif
+
+#include <malloc_wrappers.h>