From: Jay Freeman (saurik) Date: Wed, 5 Dec 2007 03:48:32 +0000 (+0000) Subject: Fixed some compile errors. X-Git-Url: https://git.saurik.com/minimal.git/commitdiff_plain/2b559b76d8223ed16589affed8e310775899a037 Fixed some compile errors. --- 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*/