make str_len an alias for strlen when on diet libc

master
leitner 22 years ago
parent 8f3278e62e
commit cd666a2b09

@ -1,6 +1,9 @@
#include "str.h" #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; register const char* t=in;
for (;;) { for (;;) {
if (!*t) break; ++t; if (!*t) break; ++t;
@ -10,3 +13,4 @@ unsigned int str_len(const char *in) {
} }
return t-in; return t-in;
} }
#endif

Loading…
Cancel
Save