1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Check for memmove and implement one if it's missing.

This commit is contained in:
hniksic 2001-11-29 11:43:29 -08:00
parent b6bbc32e14
commit 999388bfa0
5 changed files with 31 additions and 1 deletions

View File

@ -172,7 +172,7 @@ dnl Checks for library functions.
dnl dnl
AC_FUNC_ALLOCA AC_FUNC_ALLOCA
AC_FUNC_MMAP 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(gettimeofday mktime strptime)
AC_CHECK_FUNCS(strerror snprintf vsnprintf select signal symlink access isatty) AC_CHECK_FUNCS(strerror snprintf vsnprintf select signal symlink access isatty)
AC_CHECK_FUNCS(uname gethostname usleep) AC_CHECK_FUNCS(uname gethostname usleep)

View 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> 2001-11-29 Hrvoje Niksic <hniksic@arsdigita.com>
* headers: Guard against header files being included twice. * headers: Guard against header files being included twice.

View File

@ -1226,3 +1226,23 @@ usleep (unsigned long usec)
#endif /* not WINDOWS */ #endif /* not WINDOWS */
#endif /* not HAVE_USLEEP */ #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 */

View File

@ -144,6 +144,9 @@ char *alloca ();
/* Define if you have the strpbrk function. */ /* Define if you have the strpbrk function. */
#undef HAVE_STRPBRK #undef HAVE_STRPBRK
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
/* Define if you have the strptime function. */ /* Define if you have the strptime function. */
#undef HAVE_STRPTIME #undef HAVE_STRPTIME

View File

@ -166,6 +166,9 @@ int vsnprintf ();
#ifndef HAVE_USLEEP #ifndef HAVE_USLEEP
int usleep (); int usleep ();
#endif #endif
#ifndef HAVE_MEMMOVE
void *memmove ();
#endif
/* SunOS brain damage -- for some reason, SunOS header files fail to /* SunOS brain damage -- for some reason, SunOS header files fail to
declare the functions below, which causes all kinds of problems declare the functions below, which causes all kinds of problems