comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <dewar@gnat.com>
Subject: Re: Ada and C++; Any Gurus Out There?
Date: 1999/06/03
Date: 1999-06-03T00:00:00+00:00	[thread overview]
Message-ID: <7j4lua$2rs$1@nnrp1.deja.com> (raw)
In-Reply-To: slrn7lb86u.634.gisle@apal.ii.uib.no

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1698 bytes --]

In article <slrn7lb86u.634.gisle@apal.ii.uib.no>,
  gisle@apal.ii.uib.no (Gisle S�lensminde) wrote:
> Using 'extern C' is not a workaround, but the intended
> solution.

No, that's not quite right, there *was* no "intended solution".
Why not? Because at the time Ada 95 designed there was not
officially standardized C++ language, so the Ada 95 standard
could not address this particular issue.

It is perfectly possible for an Ada 95 compiler to have built
in knowlegde of such things as C++ mangling (after all it has
to have detailed knowledge of how the Fortran, C, and COBOL
compilers on a given target handle data).

Also, using the extern C approach is quite limited, it does
not for instance come close to allowing C classes to be passed
transparently and treated as Ada 95 tagged types on the Ada
side, something that the GNAT interface makes possible.

Our approach in GNAT in providing a direct interface to C++ is
to use the same data structures for tagged types as C++ uses
for classes (the run-time library must be specialized to match
a particular compiler). As far as name mangling goes, we leave
that up to the binding generator tool, which knows the mangling
scheme. In the absence of this tool, you have to figure out the
mangling yourself (not impossible at all to do from the nm
output).

As I have noted before, ACT has long term plans to make this
binding generator available, but we do not have any release
data for this product (it is the binding generator that was
used to generate all the SGI C++ bindings that come with the
SGI Ada 95 product).

Robert Dewar
Ada Core Technologies


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




  reply	other threads:[~1999-06-03  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-02  0:00 Ada and C++; Any Gurus Out There? Decker, Christian R
1999-06-02  0:00 ` Tucker Taft
1999-06-02  0:00 ` Gisle S�lensminde
1999-06-03  0:00   ` Robert Dewar [this message]
1999-06-03  0:00     ` Gisle S�lensminde
1999-06-04  0:00       ` Robert Dewar
1999-06-02  0:00 ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox