This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: CNI for C
>>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:
Andrew> Well, the nice thing about pinvoke as far as I can see is that you
Andrew> don't have to write anything: you can just call native DLLs directly.
Andrew> It's harder to do this in the general case of ISO C, because there
Andrew> aren't necessarily Java equivalents of the C types used to access
Andrew> DLLs. However, in many cases, and this possibly includes all the
Andrew> platforms we care about, there are.
Yeah. IMO if we do this the best thing to do is just look at PInvoke
and do something basically the same.
Andrew> So, we could do something like pinvoke in gcj. We'd need to figure
Andrew> out how to parse the C types and make them available to Java. We
Andrew> could get the C compiler to help with this.
I also wonder why people don't just use SWIG.
Tom