summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2001-03-19 21:33:48 +0000
committerManuel Novoa III <mjn3@codepoet.org>2001-03-19 21:33:48 +0000
commitfb1124fe102109fe336937a78b0072f4e6a206c0 (patch)
tree402498d94a8086c2b72794016ac59ca9d6a2b499 /libc
parentbb84a07a88222a21afddbf16c31d9d8b15fdda7c (diff)
Put weak symbols where they can find what they are aliasing. Clean up strcspn.c
Diffstat (limited to 'libc')
-rw-r--r--libc/string/Makefile3
-rw-r--r--libc/string/strcspn.c15
-rw-r--r--libc/string/string.c8
3 files changed, 3 insertions, 23 deletions
diff --git a/libc/string/Makefile b/libc/string/Makefile
index 4421dee1c..4d0a95da8 100644
--- a/libc/string/Makefile
+++ b/libc/string/Makefile
@@ -27,8 +27,7 @@ LIBC=$(TOPDIR)libc.a
MSRC=string.c
MOBJ=strlen.o strcat.o strcpy.o strchr.o strcmp.o strncat.o strncpy.o \
strncmp.o strrchr.o strdup.o memcpy.o memccpy.o memset.o \
- memmove.o memcmp.o memchr.o ffs.o strnlen.o index.o rindex.o \
- strxfrm.o strcoll.o
+ memmove.o memcmp.o memchr.o ffs.o strnlen.o strxfrm.o
MSRC1=strsignal.c
MOBJ1=strsignal.o psignal.o
diff --git a/libc/string/strcspn.c b/libc/string/strcspn.c
index d30195db1..b383b559a 100644
--- a/libc/string/strcspn.c
+++ b/libc/string/strcspn.c
@@ -16,20 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#if defined _LIBC || HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-# ifndef strchr
-# define strchr index
-# endif
-#endif
-
-#undef strcspn
+#include <string.h>
/* Return the length of the maximum initial segment of S
which contains no characters from REJECT. */
diff --git a/libc/string/string.c b/libc/string/string.c
index 0a38b346f..b3070907c 100644
--- a/libc/string/string.c
+++ b/libc/string/string.c
@@ -75,11 +75,9 @@ int strcmp(const char *s1, const char *s2)
return c1 - c2;
}
-#endif
-#ifdef L_strcoll
__asm__(".weak strcoll; strcoll = strcmp");
-#endif
+#endif
/********************** Function strncat ************************************/
@@ -161,9 +159,7 @@ char *strchr(const char *str, int c)
return 0;
}
-#endif
-#ifdef L_index
__asm__(".weak index; index = strchr");
#endif
@@ -186,9 +182,7 @@ char *strrchr(const char *str, int c)
}
return prev;
}
-#endif
-#ifdef L_rindex
__asm__(".weak rindex; rindex = strrchr");
#endif