Hi, I'm trying to teach kaffeh to handle overloaded native methods in -jni mode. Run it on JavahTest.class and compare the result to JavahTest.h.jdk13. You'll see that kaffeh declares two functions with same name but with different argument lists, which is illegal in C.
According to page 152 of the JNI Programmer's Guide and Specification by Sheng Liang overloaded Java native methods names are converted to C function names by adding "__" and the encoded argument list. My patch tries to fix that, but unfortunately I don't seem to be able to access an initialized CLASS_METHODS structure in order to check for duplicate methods. So I'd be glad if someone with more kaffeh hacking experience could take a closer look at it and tell me if I'm missing something obvious. As a bit of background motivation, this is the last bit holding back the merge of the ALSA based sound backend from tritonus.org. Attached you'll find the patch, an initial changelog entry, a test class and output from kaffeh -jni and javah -jni from JDK 1.3. best regards, dalibor topic __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
kaffeh-overloaded-native-naming.tar.gz
Description: kaffeh-overloaded-native-naming.tar.gz
