From fc2ee42abe595bbf6b8bbf0637648ad8b5d4faab Mon Sep 17 00:00:00 2001 From: Liubov Dmitrieva Date: Sun, 23 Oct 2011 15:17:23 -0400 Subject: Add optimized wcslen and strnlen for x86-32 --- string/strnlen.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'string') diff --git a/string/strnlen.c b/string/strnlen.c index 454257b2bc..3f52c49b60 100644 --- a/string/strnlen.c +++ b/string/strnlen.c @@ -1,5 +1,5 @@ /* Find the length of STRING, but scan at most MAXLEN characters. - Copyright (C) 1991,1993,1997,2000,2001,2005 Free Software Foundation, Inc. + Copyright (C) 1991, 1993, 1997, 2000, 2001, 2005, 2011 Free Software Foundation, Inc. Contributed by Jakub Jelinek . Based on strlen written by Torbjorn Granlund (tege@sics.se), @@ -26,8 +26,13 @@ /* Find the length of S, but scan at most MAXLEN characters. If no '\0' terminator is found in that many characters, return MAXLEN. */ + +#ifndef STRNLEN +# define STRNLEN __strnlen +#endif + size_t -__strnlen (const char *str, size_t maxlen) +STRNLEN (const char *str, size_t maxlen) { const char *char_ptr, *end_ptr = str + maxlen; const unsigned long int *longword_ptr; @@ -157,5 +162,7 @@ __strnlen (const char *str, size_t maxlen) char_ptr = end_ptr; return char_ptr - str; } +#ifndef STRNLEN weak_alias (__strnlen, strnlen) +#endif libc_hidden_def (strnlen) -- cgit 1.4.1