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:
parent
b6bbc32e14
commit
999388bfa0
@ -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)
|
||||
|
@ -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.
|
||||
|
20
src/cmpt.c
20
src/cmpt.c
@ -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 */
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user