From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ed926d4d933b76e3 X-Google-Attributes: gid103376,public From: Gary Brumfield Subject: Re: C interface - Apex/Verdix Date: 1997/06/04 Message-ID: <3395DC9F.3A25@lmco.com>#1/1 X-Deja-AN: 246269458 References: <338ce5d2.87925678@news.mhv.net> <5mjb0u$dhi@newshub.atmnet.net> To: Christopher Green Organization: Lockheed Martin Federal Systems-COS Newsgroups: comp.lang.ada Date: 1997-06-04T00:00:00+00:00 List-Id: 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.