From 20187605b01a31ec786d88f9325d1804f18f0871 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 6 Jul 2008 20:57:46 +0000 Subject: [PATCH] Fixed some C++ compilation issues. --- mapping.h | 2 ++ string.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mapping.h b/mapping.h index 3b93013..2eb53d0 100644 --- a/mapping.h +++ b/mapping.h @@ -47,6 +47,8 @@ #include #include +#include "minimal/stdlib.h" + void *map(const char *path, size_t offset, size_t size, size_t *psize, bool ro) { int fd; _syscall(fd = open(path, ro ? O_RDONLY : O_RDWR)); diff --git a/string.h b/string.h index b304134..c6ebe8b 100644 --- a/string.h +++ b/string.h @@ -41,7 +41,7 @@ #include _disused static char *strndup_(const char *src, int len) { - char *dst = malloc(len + 1); + char *dst = (char *) malloc(len + 1); _assert(dst != NULL); strncpy(dst, src, len); dst[len] = '\0'; -- 2.45.2