This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: extern "C++"
- To: osk at hem dot passagen dot se
- Subject: Re: extern "C++"
- From: Tom Tromey <tromey at cygnus dot com>
- Date: Tue, 29 Feb 2000 09:21:46 -0800 (PST)
- Cc: java-discuss at sourceware dot cygnus dot com
- References: <20000229080730.A20664@strix.eductussyd.se>
>>>>> "Oskar" == Oskar Liljeblad <osk@hem.passagen.se> writes:
Oskar> Would it be possible to inline C/C++ code in Java, like this:
Oskar> public void myMethod(int param) {
Oskar> int data;
Oskar> extern "C++" {
Oskar> data = param + 10;
Oskar> }
Oskar> }
It might be possible in theory, but in practice it might be very, very
hard.
Oskar> It would certainly make it easier to write extensions/classes with
Oskar> native code...
I don't find it all that hard to write CNI code, but then I do it with
some frequency.
There's a project called Jaguar which might do some of what you want.
It was announced here recently.
MS has something called JDirect which, I think (I haven't looked at it
yet), lets you call native methods directly from Java with no glue
code. (We don't support this though.)
Tom