From cd666a2b09d06010ba7aefdf346bfe432841cdbc Mon Sep 17 00:00:00 2001 From: leitner Date: Fri, 23 May 2003 13:07:17 +0000 Subject: [PATCH] make str_len an alias for strlen when on diet libc --- str/str_len.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/str/str_len.c b/str/str_len.c index cf1541a..c1f1638 100644 --- a/str/str_len.c +++ b/str/str_len.c @@ -1,6 +1,9 @@ #include "str.h" -unsigned int str_len(const char *in) { +#ifdef __dietlibc__ +unsigned int str_len(const char* in) __attribute__((alias("strlen"))); +#else +unsigned int str_len(const char* in) { register const char* t=in; for (;;) { if (!*t) break; ++t; @@ -10,3 +13,4 @@ unsigned int str_len(const char *in) { } return t-in; } +#endif