comp.lang.ada
 help / color / mirror / Atom feed
From: Gary Brumfield <g.brumfield@lmco.com>
To: Christopher Green <cgreen@yosemite.atc.com>
Subject: Re: C interface - Apex/Verdix
Date: 1997/06/04
Date: 1997-06-04T00:00:00+00:00	[thread overview]
Message-ID: <3395DC9F.3A25@lmco.com> (raw)
In-Reply-To: 5mjb0u$dhi@newshub.atmnet.net


Christopher Green wrote:
> 
> Apex for Ada 95 has pragma Import, which is portable.
> 
> (Language is a predefined package on VADS that provides the correct
> prefixes for external names; for example, on SunOS 4 hosts,
> Language.C_Subp_Prefix is the string "_".)
> 

I am coding in Ada95 (for the first time) using the Apex Ada 2.2.3A
compiler and need to interface with C/C++ code compiled using the Sun
compiler.  I am able to link a main Ada program with a C procedure using
the pragma Import but I have to supply the "mangled" C linker_name.  To
get this name I have to use the UNIX "nm" command on the object file. 
This seems dangerous if the C compiler ever decides to change the way
this "mangled" name is generated.  Do you know of a better way around
this?  My platform is Sun Solaris 2.5.1.  Can I use this VADS language
package and if so, where is it?

  NAME         MANGLED NAME
 ---------     ---------------
 c_routine     __0FJc_routinev


Notice that my "mangled" name also has a "v" suffix in addition to a
"__0FJ" prefix.

Also, do you know if Apex Ada will support a C++ main program
interfacing with Ada95?  This does work in GNAT when "adainit" and
"adafinal" are used.
-- 

Gary B.




  parent reply	other threads:[~1997-06-04  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-29  0:00 C interface - Apex/Verdix Paul Van Bellinghen
1997-05-29  0:00 ` Christopher Green
1997-05-30  0:00   ` Mark Bennison
1997-06-04  0:00   ` Gary Brumfield [this message]
1997-06-06  0:00     ` Arthur Schwarz
1997-06-07  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