This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: load native lib (SWT) with JNI on windows
Tom Tromey wrote:
Ranjit> BTW, as a quick hack I added something like:
Ranjit> args_size += ( this_arg_size < 4) ? 4 : this_arg_size;
Ranjit> for each "this_arg_size" representing a JNI method parameter
Ranjit> in "gcc/java/expr.c" (ref. my earlier patch)
I wish I could tell you the correct way to do this, but I don't know
it.
"Inspired" by "gcc/config/i386/winnt.c" (gen_stdcall_suffix( )),
this part *could* look something like:
------------------------ 8< ----------------------------------
for (tem = method_args; tem != NULL_TREE; tem = TREE_CHAIN (tem))
{
int arg_bits;
arg_bits = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE(tem)));
#ifdef (PARM_BOUNDARY)
arg_bits = (((arg_bits + PARM_BOUNDARY - 1)
/ PARM_BOUNDARY) * PARM_BOUNDARY);
#endif
args_size += (arg_bits / BITS_PER_UNIT);
args = tree_cons (NULL_TREE, tem, args);
}
------------------------ 8< ----------------------------------
Since I'm not too familiar with GCC internals, this could be
quite off the track. :-(
Ranjit> Unfortunately, for some reason, the interpreter still fails
Ranjit> in executing the HelloSWT program. :-(
Do you have a stack trace?
Well, stack traces are something that still don't work
with the MinGW GCJ. :-(
Since even in this case the failure is in looking
up "IsDBCSLeadByte", it should be the same error as with
the compiled code.
Ranjit.
--
Ranjit Mathew Email: rmathew AT hotmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.tripod.com/