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]
Other format: [Raw text]

Re: gcj on osx questions


Mohan Embar wrote:
First of all, I needed to make a change to natPlainSocketImplPosix.cc
to get sockets working:

void
gnu::java::net::PlainSocketImpl::bind (::java::net::InetAddress *host, jint lport)
{
  union SockAddr u;
  struct sockaddr *ptr = (struct sockaddr *) &u.address;
  jbyteArray haddress = host->addr;
  jbyte *bytes = elements (haddress);
  int len = haddress->length;
  int i = 1;

+ memset (&u, 0, sizeof (u));
  if (len == 4)

I did this against a 4.02 snapshot but am not sure where to
go from here since the trunk is already at 4.2.

This is odd. Off-hand I do not see a reason why clearing the SockAddr should be necessary, because it appears that all fields of u.sin_addr will be initialized properly, at least in the INET4 case. Do you know how/why it fails without this?


I'd like to get JNI libraries built against Apple's JDK to be loaded
by libgcj, but Andi remarked that Apple changed the structures in jni.h.
Bryce commented that through #ifdefs, it might be possible to change libgcj's
jni.h to make it compatible with Apple's.

My question is: How does one go about doing this? Are we allowed to look at the
Apple headers or does doing so taint us?

Interesting question. IIRC, in order to implement libjawt it was necessary to read their header file since the header file essentially is the specification. So, perhaps that could be considered a precedent for this being ok. Any other opinions? It would be interesting to get a diff of Apple's jni.h against the generic Sun header to see how extensive the required changes are.


Bryce


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