This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Calling java code from C/C++ code.


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 ]



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]