diff options
author | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1999-08-29 18:04:11 +0000 |
---|---|---|
committer | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1999-08-29 18:04:11 +0000 |
commit | 5e860ea7e2164ca273fca20490c09e07f0b747d3 (patch) | |
tree | af3f6762e4ebe666f37a9ced9f20f0e3e2f8b4e8 | |
parent | f326ecf3863233f6e82fa182eb829fa77405204a (diff) | |
download | guile-5e860ea7e2164ca273fca20490c09e07f0b747d3.tar.gz |
* gh_data.c, ports.c, strop.c: Alternatively use bcopy if memmove
isn't present. (Thanks to suzukis@file.phys.tohoku.ac.jp.)
-rw-r--r-- | libguile/gh_data.c | 8 | ||||
-rw-r--r-- | libguile/strop.c | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/libguile/gh_data.c b/libguile/gh_data.c index 8a100ecda..e58a0a4dc 100644 --- a/libguile/gh_data.c +++ b/libguile/gh_data.c @@ -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); } diff --git a/libguile/strop.c b/libguile/strop.c index 7a2f344e6..769207ad5 100644 --- a/libguile/strop.c +++ b/libguile/strop.c @@ -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); } |