Only use local mempcpy() if system libraries dont provide one

- Obvious yes, but how come this didn't barf on my other rather
  identical system? Meh.
This commit is contained in:
Panu Matilainen 2012-05-31 18:09:23 +03:00
parent 794e24456a
commit ac8a0175be
2 changed files with 3 additions and 0 deletions

View File

@ -478,6 +478,7 @@ dnl Checks for library functions.
AC_FUNC_MMAP
AC_CHECK_FUNCS(putenv)
AC_CHECK_FUNCS(mempcpy)
AC_REPLACE_FUNCS(stpcpy stpncpy)

View File

@ -110,10 +110,12 @@ static int glob_in_dir(const char *pattern, const char *directory,
static int prefix_array(const char *prefix, char **array, size_t n);
static int collated_compare(const void *, const void *);
#ifndef HAVE_MEMPCPY
static void * mempcpy(void *dest, const void *src, size_t n)
{
return (char *) memcpy(dest, src, n) + n;
}
#endif
/* Find the end of the sub-pattern in a brace expression. We define
this as an inline function if the compiler permits. */