Calling java code from C/C++ code.
Bryce McKinlay
bryce@albatross.co.nz
Fri Mar 2 13:04:00 GMT 2001
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 ]
More information about the Java
mailing list