aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-04-14 14:01:29 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-09-09 16:32:30 +0900
commit7c2aecc1d33d45742de835317f7ff0a16b31b01f (patch)
treea84ec6294261051023a8b92373f409317c841a56
parent638342c2c177889ad7b4bc51ef7412c45ffd7b0c (diff)
downloadruby-7c2aecc1d33d45742de835317f7ff0a16b31b01f.tar.gz
configure.in: remove obsolete string.h replacements
-rw-r--r--LEGAL4
-rw-r--r--common.mk5
-rw-r--r--configure.in4
-rw-r--r--include/ruby/missing.h23
-rw-r--r--missing/memmove.c22
-rw-r--r--missing/strchr.c32
-rw-r--r--missing/strerror.c18
-rw-r--r--missing/strstr.c29
-rw-r--r--win32/Makefile.sub6
9 files changed, 0 insertions, 143 deletions
diff --git a/LEGAL b/LEGAL
index a8fc678283..85142ce27a 100644
--- a/LEGAL
+++ b/LEGAL
@@ -386,10 +386,6 @@ missing/isinf.c:
missing/isnan.c:
missing/lgamma_r.c:
missing/memcmp.c:
-missing/memmove.c:
-missing/strchr.c:
-missing/strerror.c:
-missing/strstr.c:
missing/tgamma.c:
ext/date/date_strftime.c:
ext/digest/sha1/sha1.[ch]:
diff --git a/common.mk b/common.mk
index 9d5448fc49..e78f1b052f 100644
--- a/common.mk
+++ b/common.mk
@@ -805,15 +805,10 @@ explicit_bzero.$(OBJEXT): {$(VPATH)}explicit_bzero.c
finite.$(OBJEXT): {$(VPATH)}finite.c
flock.$(OBJEXT): {$(VPATH)}flock.c
memcmp.$(OBJEXT): {$(VPATH)}memcmp.c
-memmove.$(OBJEXT): {$(VPATH)}memmove.c
mkdir.$(OBJEXT): {$(VPATH)}mkdir.c
setproctitle.$(OBJEXT): {$(VPATH)}setproctitle.c
-strchr.$(OBJEXT): {$(VPATH)}strchr.c
-strdup.$(OBJEXT): {$(VPATH)}strdup.c
-strerror.$(OBJEXT): {$(VPATH)}strerror.c
strlcat.$(OBJEXT): {$(VPATH)}strlcat.c
strlcpy.$(OBJEXT): {$(VPATH)}strlcpy.c
-strstr.$(OBJEXT): {$(VPATH)}strstr.c
nt.$(OBJEXT): {$(VPATH)}nt.c
ia64.$(OBJEXT): {$(VPATH)}ia64.s
$(CC) $(CFLAGS) -c $<
diff --git a/configure.in b/configure.in
index bdf26b9799..7a46e5eb63 100644
--- a/configure.in
+++ b/configure.in
@@ -2254,14 +2254,10 @@ AC_REPLACE_FUNCS(hypot)
AC_REPLACE_FUNCS(isinf)
AC_REPLACE_FUNCS(isnan)
AC_REPLACE_FUNCS(lgamma_r)
-AC_REPLACE_FUNCS(memmove)
AC_REPLACE_FUNCS(nextafter)
AC_REPLACE_FUNCS(setproctitle)
-AC_REPLACE_FUNCS(strchr)
-AC_REPLACE_FUNCS(strerror)
AC_REPLACE_FUNCS(strlcat)
AC_REPLACE_FUNCS(strlcpy)
-AC_REPLACE_FUNCS(strstr)
AC_REPLACE_FUNCS(tgamma)
# for missing/setproctitle.c
diff --git a/include/ruby/missing.h b/include/ruby/missing.h
index f70a7e64d9..700100eca9 100644
--- a/include/ruby/missing.h
+++ b/include/ruby/missing.h
@@ -177,29 +177,6 @@ RUBY_EXTERN int isnan(double);
RUBY_EXTERN double nextafter(double x, double y);
#endif
-/*
-#ifndef HAVE_MEMCMP
-RUBY_EXTERN int memcmp(const void *, const void *, size_t);
-#endif
-*/
-
-#ifndef HAVE_MEMMOVE
-RUBY_EXTERN void *memmove(void *, const void *, size_t);
-#endif
-
-#ifndef HAVE_STRCHR
-RUBY_EXTERN char *strchr(const char *, int);
-RUBY_EXTERN char *strrchr(const char *, int);
-#endif
-
-#ifndef HAVE_STRERROR
-RUBY_EXTERN char *strerror(int);
-#endif
-
-#ifndef HAVE_STRSTR
-RUBY_EXTERN char *strstr(const char *, const char *);
-#endif
-
#ifndef HAVE_STRLCPY
RUBY_EXTERN size_t strlcpy(char *, const char*, size_t);
#endif
diff --git a/missing/memmove.c b/missing/memmove.c
deleted file mode 100644
index e8e17e87e7..0000000000
--- a/missing/memmove.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* public domain rewrite of memcmp(3) */
-
-#include "ruby/missing.h"
-#include <stddef.h>
-
-void *
-memmove(void *d, const void *s, size_t n)
-{
- char *dst = (char *)d;
- const char *src = (const char *)s;
-
- if (src < dst) {
- src += n;
- dst += n;
- for (; n; --n)
- *--dst = *--src;
- }
- else if (dst < src)
- for (; n; --n)
- *dst++ = *src++;
- return d;
-}
diff --git a/missing/strchr.c b/missing/strchr.c
deleted file mode 100644
index 465f07b61e..0000000000
--- a/missing/strchr.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* public domain rewrite of strchr(3) and strrchr(3) */
-
-#include "ruby/missing.h"
-
-size_t strlen(const char*);
-
-char *
-strchr(const char *s, int c)
-{
- if (c == 0) return (char *)s + strlen(s);
- while (*s) {
- if (*s == c)
- return (char *)s;
- s++;
- }
- return 0;
-}
-
-char *
-strrchr(const char *s, int c)
-{
- const char *save;
-
- if (c == 0) return (char *)s + strlen(s);
- save = 0;
- while (*s) {
- if (*s == c)
- save = s;
- s++;
- }
- return (char *)save;
-}
diff --git a/missing/strerror.c b/missing/strerror.c
deleted file mode 100644
index d3b61c3f12..0000000000
--- a/missing/strerror.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* public domain rewrite of strerror(3) */
-
-#include "ruby/missing.h"
-
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-static char msg[50];
-
-char *
-strerror(int error)
-{
- if (error <= sys_nerr && error > 0) {
- return sys_errlist[error];
- }
- snprintf(msg, sizeof(msg), "Unknown error (%d)", error);
- return msg;
-}
diff --git a/missing/strstr.c b/missing/strstr.c
deleted file mode 100644
index e6613c5d2f..0000000000
--- a/missing/strstr.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* public domain rewrite of strstr(3) */
-
-#include "ruby/missing.h"
-
-size_t strlen(const char*);
-
-char *
-strstr(const char *haystack, const char *needle)
-{
- const char *hend;
- const char *a, *b;
-
- if (*needle == 0) return (char *)haystack;
- hend = haystack + strlen(haystack) - strlen(needle) + 1;
- while (haystack < hend) {
- if (*haystack == *needle) {
- a = haystack;
- b = needle;
- for (;;) {
- if (*b == 0) return (char *)haystack;
- if (*a++ != *b++) {
- break;
- }
- }
- }
- haystack++;
- }
- return 0;
-}
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 68ca137bec..38fe19c1fb 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -713,17 +713,11 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
#define HAVE_ALLOCA 1
#define HAVE_DUP2 1
#define HAVE_MEMCMP 1
-#define HAVE_MEMMOVE 1
#define HAVE_MKDIR 1
#define HAVE_CLOCK_GETTIME 1
#define HAVE_CLOCK_GETRES 1
#define HAVE_SPAWNV 1
-#define HAVE_STRCASECMP 1
-#define HAVE_STRNCASECMP 1
-#define HAVE_STRERROR 1
#define HAVE_STRFTIME 1
-#define HAVE_STRCHR 1
-#define HAVE_STRSTR 1
#define HAVE_FLOCK 1
#define HAVE_ISNAN 1
#define HAVE_FINITE 1