mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +02:00
I take it all back --- bcopy does handle overlapping source and
destination areas correctly. At least on every system I could find. But it is better to use AC_REPLACE_FUNCS than to introduce new CPP conditionals. * memmove.c: New file, implementing memmove in terms of bcopy. * scmconfig.h.in: Regenerated.
This commit is contained in:
parent
b074884f06
commit
be881b4688
2 changed files with 24 additions and 3 deletions
24
libguile/memmove.c
Normal file
24
libguile/memmove.c
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
/* Wrapper to implement ANSI C's memmove using BSD's bcopy. */
|
||||||
|
/* This function is in the public domain. --Per Bothner. */
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#ifdef __STDC__
|
||||||
|
#define PTR void *
|
||||||
|
#define CPTR const void *
|
||||||
|
PTR memmove (PTR, CPTR, size_t);
|
||||||
|
#else
|
||||||
|
#define PTR char *
|
||||||
|
#define CPTR char *
|
||||||
|
PTR memmove ();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
PTR
|
||||||
|
memmove (s1, s2, n)
|
||||||
|
PTR s1;
|
||||||
|
CPTR s2;
|
||||||
|
size_t n;
|
||||||
|
{
|
||||||
|
bcopy (s2, s1, n);
|
||||||
|
return s1;
|
||||||
|
}
|
|
@ -176,9 +176,6 @@
|
||||||
/* Define if you have the atexit function. */
|
/* Define if you have the atexit function. */
|
||||||
#undef HAVE_ATEXIT
|
#undef HAVE_ATEXIT
|
||||||
|
|
||||||
/* Define if you have the bcopy function. */
|
|
||||||
#undef HAVE_BCOPY
|
|
||||||
|
|
||||||
/* Define if you have the bzero function. */
|
/* Define if you have the bzero function. */
|
||||||
#undef HAVE_BZERO
|
#undef HAVE_BZERO
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue