On Tue, Sep 13, 2005 at 03:16:55PM -0600, Shaun Jackman wrote: > 2005/9/13, Steve Langasek <[EMAIL PROTECTED]>: > > Which is a pretty lame excuse, because sizeof(long) == 4 on 32-bit archs > > (not just Linux but most other platforms as well), and sizeof(long) == 8 > > on 64-bit archs... > > I believe part of the issue is that the width of the type used in the > Java sources needs to match the width of the type used in the C > sources, and in Java sizeof(long) is always eight bytes, and > sizeof(int) is always four bytes. The choice of which type is used > then affects the signature of the JNI function call.
Right. Another solution would have been to always use long in the java code and jlong in the native C code. This got rejected because it "uses too much memory". Well, they get what they cry for. Cheers, Michael -- Escape the Java Trap with GNU Classpath! http://www.gnu.org/philosophy/java-trap.html Join the community at http://planet.classpath.org/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]