This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: extern "C++"


>>>>> "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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]