[kaffe] [bug] kaffeh can't handle overloaded native methods
Dalibor Topic
robilad@yahoo.com
Fri, 27 Dec 2002 15:00:14 -0800 (PST)
--0-547812573-1041030014=:15648
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
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
--0-547812573-1041030014=:15648
Content-Type: application/x-gzip-compressed; name="kaffeh-overloaded-native-naming.tar.gz"
Content-Transfer-Encoding: base64
Content-Description: kaffeh-overloaded-native-naming.tar.gz
Content-Disposition: attachment; filename="kaffeh-overloaded-native-naming.tar.gz"
H4sIAGrhDD4AA+0Za2/byJG6JJeKPffu0j8wcZBYT5ukXoacBHYcX+PAZweR
mhpID8KKXEm0KVLlwz4n8I/qpwL90B/QH1V0ZpekpJxsxa7PaVEtbC65uzM7
O+8dHbNejw/K3gn3HY9Z3Cq7LLRPOHZD2+2vKTfQNK2qNWo17DWtUZ/u46bg
gFbR61q1Xlc0vW4YFQVqN7H5vBYFIfMBlNAb2eYl6+bN/4+24znyf81O2KDN
g3DVdFgQXGsPTdculX+1pgv5G/VKvaGjLhi6XjUU0G74rDPb/7n8//mvv/9D
uaOUld+r2H13X/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