extern "C++"
Tom Tromey
tromey@cygnus.com
Sat Apr 1 00:00:00 GMT 2000
>>>>> "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
More information about the Java
mailing list