This is the mail archive of the java-patches@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: MingW32 3.4 Cleanup / Refactoring / Enhancements


Hi Ranjit,

I've taken the liberty of CCing java-patches on this because our
discussions are pretty fruitful and I thought it might be useful that
others listened in.

For those of you joining us, this is an informal discussion of this:

http://gcc.gnu.org/ml/java-patches/2003-q2/msg00567.html

>The JStringToCString, throwIOException, etc. look like more globally
>useful methods than just win32....

I'll bring up JStringToCString at java-patches in a separate post.

>However, I really don't see the great advantage of rather trivial
>methods like throwIOException...

In Win32, if you do this:

   throw new java::io::IOException(winstrerror(WSAGetLastError());

then WSAGetLastError() becomes 0 by the time it's evaluated. The
only way I found around this is:

   DWORD dwLastErrorCode = WSAGetLastError();
   throw new java::io::IOException(winstrerror(dwLastErrorCode));

I was irritated enough by the repeated duplication of the above two
lines that I introduced a helper function. This "feature" is not present
in the POSIX world, so I don't know if such functions would be useful
there. (Though frankly, I got a bit tired of reading throw new X(strerror(errno))
after awhile. The more people know me, the more they know I
abhor code duplication.)

>... specially since they introduce another stack frame in an exception
>backtrace.

Does the stacktrace also include additional levels of indirection in
native code?

>Your patch actually introduces a typo in java/io/natFileWin32.cc
>("Java timestamps are millisecosince ...").

Thanks for catching this.

>Why do you remove the DISABLE_JAVA_NET checks? IIRC, the GCJ
>configury supports a "--disable-java-net" option that controls this
>definition.

See these posts:

http://gcc.gnu.org/ml/java-patches/2003-q1/msg00760.html
http://gcc.gnu.org/ml/java-patches/2003-q2/msg00100.html

To summarize: when -disable-java-net is specified, we symlink to entirely
different files (nat*NoNet.cc) and not the nat*Win32.cc variants.

-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/





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