1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 22:31:12 +02:00

* gh_data.c, ports.c, strop.c: Alternatively use bcopy if memmove

isn't present.  (Thanks to suzukis@file.phys.tohoku.ac.jp.)
This commit is contained in:
Mikael Djurfeldt 1999-08-29 18:04:11 +00:00
parent f326ecf386
commit 5e860ea7e2
2 changed files with 18 additions and 0 deletions

View file

@ -115,7 +115,15 @@ gh_set_substr (char *src, SCM dst, int start, int len)
scm_protect_object (dst);
effective_length = ((unsigned) len < dst_len) ? len : dst_len;
#ifdef HAVE_MEMMOVE
memmove (dst_ptr + start, src, effective_length);
#else
#ifdef HAVE_BCOPY
bcopy (src, dst_ptr + start, effective_length);
#else
#error Need memmove. Please send a bug report to bug-guile@gnu.org.
#endif
#endif
scm_unprotect_object (dst);
}

View file

@ -147,9 +147,19 @@ scm_substring_move_x (SCM str1, SCM start1, SCM end1,
SCM_ASSERT (len+s2 <= SCM_LENGTH (str2), start2,
SCM_OUTOFRANGE, s_substring_move_x);
#ifdef HAVE_MEMMOVE
SCM_SYSCALL(memmove((void *)(&(SCM_CHARS(str2)[s2])),
(void *)(&(SCM_CHARS(str1)[s1])),
len));
#else
#ifdef HAVE_BCOPY
SCM_SYSCALL(bcopy((void *)(&(SCM_CHARS(str1)[s1])),
(void *)(&(SCM_CHARS(str2)[s2])),
len));
#else
#error Need memmove. Please send a bug report to bug-guile@gnu.org.
#endif
#endif
return scm_return_first(SCM_UNSPECIFIED, str1, str2);
}