This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Calling java code from C/C++ code.
- To: twall at oculustech dot com
- Subject: Re: Calling java code from C/C++ code.
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Sat, 03 Mar 2001 10:06:02 +1300
- CC: tromey at redhat dot com, java at gcc dot gnu dot org
- References: <3A9BE61C.3F2936FC@cygnus.com> <87u25grna6.fsf@creche.redhat.com> <3A9BFC3A.800ADB7C@oculustech.com> <3A9C18C6.DA0EF9E4@albatross.co.nz> <3A9FF5C5.9BC6DB6F@oculustech.com>
Timothy Wall wrote:
> I tried the patch but apparently it didn't apply cleanly to Class.h. Can you
> post the correct Class constructors?
With the patch, there is only one C++ constructor for class:
Class ()
{
// C++ ctors set the vtbl pointer to point at an offset inside the vtable
// object. That doesn't work for Java, so this hack adjusts it back.
void *p = ((void **)this)[0];
((void **)this)[0] = (void *)((char *)p-2*sizeof (void *));
};
(reading the patch may be confusing because the other one is commented out
instead of removed. sorry about that)
regards
[ bryce ]