From: Jay Freeman (saurik) Date: Sun, 6 Jul 2008 20:57:46 +0000 (+0000) Subject: Fixed some C++ compilation issues. X-Git-Url: https://git.saurik.com/minimal.git/commitdiff_plain/20187605b01a31ec786d88f9325d1804f18f0871?ds=inline Fixed some C++ compilation issues. --- 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';