]> sjero.net Git - wget/commitdiff
[svn] Check for memmove and implement one if it's missing.
authorhniksic <devnull@localhost>
Thu, 29 Nov 2001 19:43:29 +0000 (11:43 -0800)
committerhniksic <devnull@localhost>
Thu, 29 Nov 2001 19:43:29 +0000 (11:43 -0800)
configure.in
src/ChangeLog
src/cmpt.c
src/config.h.in
src/sysdep.h

index 0ed629bf81f803c5d95db2b7cb92701fda4a1a51..19f4423a6da7743e70cbf8c204375c5938e661fe 100644 (file)
@@ -172,7 +172,7 @@ dnl Checks for library functions.
 dnl
 AC_FUNC_ALLOCA
 AC_FUNC_MMAP
-AC_CHECK_FUNCS(strdup strstr strcasecmp strncasecmp strpbrk)
+AC_CHECK_FUNCS(strdup strstr strcasecmp strncasecmp strpbrk memmove)
 AC_CHECK_FUNCS(gettimeofday mktime strptime)
 AC_CHECK_FUNCS(strerror snprintf vsnprintf select signal symlink access isatty)
 AC_CHECK_FUNCS(uname gethostname usleep)
index fc445bc36c364563645ceb234e388a8164c4bc61..defa970ec02b0d36455ab66ca8c181f0e16e7e90 100644 (file)
@@ -1,3 +1,7 @@
+2001-11-29  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * cmpt.c (memmove): Include a simple memmove implementation.
+
 2001-11-29  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * headers: Guard against header files being included twice.
index 6fb7fc0413442c82a406ee53f304fdc781b5902b..81502d779d689988dd3f05640031ea306ff43bf1 100644 (file)
@@ -1226,3 +1226,23 @@ usleep (unsigned long usec)
 
 #endif /* not WINDOWS */
 #endif /* not HAVE_USLEEP */
+
+
+#ifndef HAVE_MEMMOVE
+void *
+memmove (char *dest, const char *source, unsigned length)
+{
+  char *d0 = dest;
+  if (source < dest)
+    /* Moving from low mem to hi mem; start at end.  */
+    for (source += length, dest += length; length; --length)
+      *--dest = *--source;
+  else if (source != dest)
+    {
+      /* Moving from hi mem to low mem; start at beginning.  */
+      for (; length; --length)
+       *dest++ = *source++;
+    }
+  return (void *) d0;
+}
+#endif /* not HAVE_MEMMOVE */
index c6413d608a385ea29f283a50649edacfce127c49..8eaa4b61ad60c95d73f6bbb264d23faab223e905 100644 (file)
@@ -144,6 +144,9 @@ char *alloca ();
 /* Define if you have the strpbrk function.  */
 #undef HAVE_STRPBRK
 
+/* Define if you have the memmove function.  */
+#undef HAVE_MEMMOVE
+
 /* Define if you have the strptime function.  */
 #undef HAVE_STRPTIME
 
index 7ac88bc57d42bb97fcd1c9d0b42e632f29aa21cb..226a8c545246668f8e7337861631d7c67902d5aa 100644 (file)
@@ -166,6 +166,9 @@ int vsnprintf ();
 #ifndef HAVE_USLEEP
 int usleep ();
 #endif
+#ifndef HAVE_MEMMOVE
+void *memmove ();
+#endif
 
 /* SunOS brain damage -- for some reason, SunOS header files fail to
    declare the functions below, which causes all kinds of problems