public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: extern "C++"
  2000-04-01  0:00 extern "C++" Oskar Liljeblad
@ 2000-04-01  0:00 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2000-04-01  0:00 UTC (permalink / raw)
  To: osk; +Cc: java-discuss

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* extern "C++"
@ 2000-04-01  0:00 Oskar Liljeblad
  2000-04-01  0:00 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Oskar Liljeblad @ 2000-04-01  0:00 UTC (permalink / raw)
  To: java-discuss

Hello

Would it be possible to inline C/C++ code in Java, like this:

  SomeClass.java:

  public void myMethod(int param) {
      int data;

      extern "C++" {
          data = param + 10;
      }
  }

It would certainly make it easier to write extensions/classes with
native code...

Oskar Liljeblad (osk@hem.passagen.se)

PS. Isn't there another project to allow Perl code to be inlined in Java? DS.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-04-01  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-01  0:00 extern "C++" Oskar Liljeblad
2000-04-01  0:00 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).