This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Re: SunOS4 is missing memmove
- To: Per Bothner <per@bothner.com>
- Subject: Re: SunOS4 is missing memmove
- From: Alexandre Oliva <oliva@dcc.unicamp.br>
- Date: 20 Jul 1999 18:40:47 -0300
- Cc: java-discuss@sourceware.cygnus.com, java-patches@sourceware.cygnus.com
- References: <oremi32ovj.fsf@cupuacu.lsd.dcc.unicamp.br> <m2vhbfxjb6.fsf@magnus.bothner.com> <199907201833.LAA04503@ferrule.cygnus.com.> <m2so6jxiqr.fsf@magnus.bothner.com> <or7lnv106z.fsf@cupuacu.lsd.dcc.unicamp.br>
On Jul 20, 1999, Alexandre Oliva <oliva@dcc.unicamp.br> wrote:
> I haven't completed the build on StunOS4 yet (it's stunningly slow
> :-), but I'll let you know if this patch is not enough.
Duh! I didn't expect to have to reply so fast! :-)
The patch was completely bogus. I thought I was just removing the
test for memmove, but I ended up removing the check for its existence
too. Here's a revised patch:
Index: libjava/ChangeLog
from Alexandre Oliva <oliva@dcc.unicamp.br>
* java/lang/natSystem.cc (arraycopy): Use bcopy if memmove is not
available. Don't cast memmove args to (void*).
* configure.in: Do not abort if memmove is not available.
Index: libjava/configure.in
===================================================================
RCS file: /cvs/java/libgcj/libjava/configure.in,v
retrieving revision 1.11.2.1
diff -u -r1.11.2.1 configure.in
--- libjava/configure.in 1999/06/24 20:14:59 1.11.2.1
+++ libjava/configure.in 1999/07/20 21:00:01
@@ -342,12 +342,7 @@
AC_MSG_ERROR([no function found to get the time])
fi
- # We require memmove.
- memmove_found=no
- AC_CHECK_FUNCS(memmove, memmove_found=yes)
- if test "$memmove_found" = no; then
- AC_MSG_ERROR([memmove is required])
- fi
+ AC_CHECK_FUNCS(memmove)
# We require memcpy.
memcpy_found=no
Index: libjava/java/lang/natSystem.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/natSystem.cc,v
retrieving revision 1.7
diff -u -r1.7 natSystem.cc
--- libjava/java/lang/natSystem.cc 1999/05/17 13:24:59 1.7
+++ libjava/java/lang/natSystem.cc 1999/07/20 21:00:02
@@ -171,9 +171,14 @@
dst_elts = (char *) elements ((jdoubleArray) dst);
dst_elts += size * dst_offset;
+#if HAVE_MEMMOVE
// We don't bother trying memcpy. It can't be worth the cost of
// the check.
- memmove ((void *) dst_elts, (void *) src_elts, count * size);
+ // Don't cast to (void*), as memmove may expect (char*)
+ memmove (dst_elts, src_elts, count * size);
+#else
+ bcopy (src_elts, dst_elts, count * size);
+#endif
}
else
{
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{dcc.unicamp.br,guarana.{org,com}} aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them