diff options
Diffstat (limited to 'libc/string/generic')
| -rw-r--r-- | libc/string/generic/Makefile | 49 | ||||
| -rw-r--r-- | libc/string/generic/bp-checks.h | 2 | ||||
| -rw-r--r-- | libc/string/generic/memmem.c | 2 | ||||
| -rw-r--r-- | libc/string/generic/memmove.c | 2 | ||||
| -rw-r--r-- | libc/string/generic/mempcpy.c | 4 | ||||
| -rw-r--r-- | libc/string/generic/strcspn.c | 2 | ||||
| -rw-r--r-- | libc/string/generic/strrchr.c | 4 | ||||
| -rw-r--r-- | libc/string/generic/strsep.c | 4 | ||||
| -rw-r--r-- | libc/string/generic/strtok_r.c | 4 |
9 files changed, 23 insertions, 50 deletions
diff --git a/libc/string/generic/Makefile b/libc/string/generic/Makefile index fac678a59..4a8f4a072 100644 --- a/libc/string/generic/Makefile +++ b/libc/string/generic/Makefile @@ -1,46 +1,13 @@ # Makefile for uClibc # -# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -TOPDIR=../../../ -include $(TOPDIR)Rules.mak - -CSRC= memchr.c memcmp.c memcpy.c memmem.c memmove.c mempcpy.c memrchr.c \ - memset.c rawmemchr.c strcat.c strchr.c strchrnul.c strcmp.c strcpy.c \ - strcspn.c strlen.c strncat.c strncmp.c strncpy.c strnlen.c \ - strrchr.c strsep.c strspn.c strstr.c strtok_r.c - -COBJS=$(patsubst %.c,%.o, $(CSRC)) -OBJS=$(COBJS) - -OBJ_LIST=../../obj.string.generic - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) - echo $(patsubst %, string/generic/%, $(OBJS)) > $(OBJ_LIST) - -# $(MOBJ): $(MSRC) -# $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o -# $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -clean: - $(RM) *.[oa] *~ core +top_srcdir=../../../ +top_builddir=../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.in +include $(top_srcdir)Makerules diff --git a/libc/string/generic/bp-checks.h b/libc/string/generic/bp-checks.h index efbb84716..08c70aa5d 100644 --- a/libc/string/generic/bp-checks.h +++ b/libc/string/generic/bp-checks.h @@ -92,7 +92,7 @@ extern void *__unbounded __ubp_memchr (const void *__unbounded, int, unsigned); cover a region of NBYTES. Such a vector occupies one byte per page of memory. */ # define CHECK_N_PAGES(ARG, NBYTES) \ - ({ int _page_size_ = sysconf (_SC_PAGE_SIZE); \ + ({ int _page_size_ = __sysconf (_SC_PAGE_SIZE); \ CHECK_N ((const char *) (ARG), \ ((NBYTES) + _page_size_ - 1) / _page_size_); }) diff --git a/libc/string/generic/memmem.c b/libc/string/generic/memmem.c index 5f2c1e244..05d7de639 100644 --- a/libc/string/generic/memmem.c +++ b/libc/string/generic/memmem.c @@ -41,7 +41,7 @@ void attribute_hidden *__memmem (const void *haystack, size_t haystack_len, for (begin = (const char *) haystack; begin <= last_possible; ++begin) if (begin[0] == ((const char *) needle)[0] && - !memcmp ((const void *) &begin[1], + !__memcmp ((const void *) &begin[1], (const void *) ((const char *) needle + 1), needle_len - 1)) return (void *) begin; diff --git a/libc/string/generic/memmove.c b/libc/string/generic/memmove.c index ddf7c8aa4..0e649a1a9 100644 --- a/libc/string/generic/memmove.c +++ b/libc/string/generic/memmove.c @@ -219,7 +219,7 @@ void attribute_hidden *__memmove (void *dest, const void *src, size_t len) { #if 1 #warning REMINDER: generic-opt memmove assumes memcpy does forward copying! - memcpy(dest, src, len); + __memcpy(dest, src, len); #else /* Copy from the beginning to the end. */ diff --git a/libc/string/generic/mempcpy.c b/libc/string/generic/mempcpy.c index cda156edf..f2c860107 100644 --- a/libc/string/generic/mempcpy.c +++ b/libc/string/generic/mempcpy.c @@ -11,8 +11,8 @@ void attribute_hidden *__mempcpy (void *dstpp, const void *srcpp, size_t len) { - memcpy(dstpp, srcpp, len); + __memcpy(dstpp, srcpp, len); return (void *)(((char *)dstpp) + len); } -strong_alias (__mempcpy, mempcpy) +strong_alias(__mempcpy,mempcpy) diff --git a/libc/string/generic/strcspn.c b/libc/string/generic/strcspn.c index c41132cf6..a10912e25 100644 --- a/libc/string/generic/strcspn.c +++ b/libc/string/generic/strcspn.c @@ -27,7 +27,7 @@ size_t attribute_hidden __strcspn (const char *s, const char *reject) size_t count = 0; while (*s != '\0') - if (strchr (reject, *s++) == NULL) + if (__strchr (reject, *s++) == NULL) ++count; else return count; diff --git a/libc/string/generic/strrchr.c b/libc/string/generic/strrchr.c index bde4d4da0..325be7d48 100644 --- a/libc/string/generic/strrchr.c +++ b/libc/string/generic/strrchr.c @@ -30,10 +30,10 @@ char attribute_hidden *__strrchr (const char *s, int c) /* Since strchr is fast, we use it rather than the obvious loop. */ if (c == '\0') - return strchr (s, '\0'); + return __strchr (s, '\0'); found = NULL; - while ((p = strchr (s, c)) != NULL) + while ((p = __strchr (s, c)) != NULL) { found = p; s = p + 1; diff --git a/libc/string/generic/strsep.c b/libc/string/generic/strsep.c index 77670607b..9515fa193 100644 --- a/libc/string/generic/strsep.c +++ b/libc/string/generic/strsep.c @@ -16,6 +16,8 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#define strpbrk __strpbrk + #include <string.h> #undef strsep @@ -44,7 +46,7 @@ char attribute_hidden *__strsep (char **stringp, const char *delim) else if (*begin == '\0') end = NULL; else - end = strchr (begin + 1, ch); + end = __strchr (begin + 1, ch); } } else diff --git a/libc/string/generic/strtok_r.c b/libc/string/generic/strtok_r.c index 40d4e1a78..6daa68124 100644 --- a/libc/string/generic/strtok_r.c +++ b/libc/string/generic/strtok_r.c @@ -17,6 +17,10 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#define rawmemchr __rawmemchr +#define strspn __strspn +#define strpbrk __strpbrk + #define _GNU_SOURCE #include <string.h> |
