From 2b559b76d8223ed16589affed8e310775899a037 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 5 Dec 2007 03:48:32 +0000 Subject: [PATCH] Fixed some compile errors. --- stdlib.h | 6 ++++++ string.h | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/stdlib.h b/stdlib.h index 9610429..21fd7d7 100644 --- a/stdlib.h +++ b/stdlib.h @@ -60,6 +60,12 @@ #define _not(type) \ ((type) ~ (type) 0) +#define _breakpoint() \ + __asm__ { int 0x3 } + +#define _unused \ + __attribute__((unused)) + #include #include #include diff --git a/string.h b/string.h index 6a64597..c259399 100644 --- a/string.h +++ b/string.h @@ -1,9 +1,14 @@ +#ifndef MINIMAL_STRING_H +#define MINIMAL_STRING_H + #include -char *strndup_(const char *src, int len) { +_unused static char *strndup_(const char *src, int len) { char *dst = malloc(len + 1); _assert(dst != NULL); strncpy(dst, src, len); dst[len] = '\0'; return dst; } + +#endif/*MINIMAL_STRING_H*/ -- 2.50.0