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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1b5a1e8589d6a2eb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newshub.sdsu.edu!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Wed, 16 Mar 2005 16:16:18 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1110978291.469762.247330@g14g2000cwa.googlegroups.com> <1110984799.156059.248460@z14g2000cwz.googlegroups.com> <87hdjb5kqd.fsf@insalien.org> Subject: Re: combine Ada with MS VS C++ Date: Wed, 16 Mar 2005 16:18:40 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4927.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Message-ID: <4smdnRkGBLevLaXfRVn-rw@megapath.net> NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-U5crJ2nUpBHR4sZxTOTAA1SdkJTqDKjGuJfPACOnD57RSpNqya/HlxZMDbYnvJsNbhB1fvFYR2VGYxp!tMV/ksiU8PhZbDSS6S8sqDt7IIM/B7I1RlZIq7YDvvaNz5uxb5ssIZYRCOPZlhk9Zs4j47TB5ptF X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:9522 Date: 2005-03-16T16:18:40-06:00 List-Id: "Ludovic Brenta" wrote in message news:87hdjb5kqd.fsf@insalien.org... > writes: ... > I don't program on Windows, so I can't help you with the exporting > from Ada. You may need to use all three arguments to pragma Export in > order to get the link name right; this is the platform-dependent part. > So you'd say something like: > > procedure Check_Buffer (vr, vl : in out Interfaces.C.double); > pragma Export (Convention => C, Entity => Check_Buffer, > External_Name => "CheckBuffer", -- this is... > Link_Name => "something"); -- ...the hard part I'd leave out the link name part. The intent is that you specify *either* the link name *or* the external name. The external name is the name as it appears in C. I think all Windows Ada compilers can generate the link name from that name; certainly we only used the External_Name in Claw to link to Win32. This only works if you turn off name-mangling as suggested in the previous response. You could use the link name instead to manually provide the mangled name, but that seems like a lot of work for little gain. Randy.