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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!z19g2000vbz.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Interfacing with C Date: Mon, 18 May 2009 04:51:38 -0700 (PDT) Organization: http://groups.google.com Message-ID: <4395a113-28cc-4a34-bcd3-c05da82872fa@z19g2000vbz.googlegroups.com> References: <250d9b93-13bf-4375-8b35-a1b0a7f74d99@j12g2000vbl.googlegroups.com> NNTP-Posting-Host: 137.138.182.236 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1242647499 18025 127.0.0.1 (18 May 2009 11:51:39 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 18 May 2009 11:51:39 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z19g2000vbz.googlegroups.com; posting-host=137.138.182.236; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.8) Gecko/2009032608 Firefox/3.0.8,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:5895 Date: 2009-05-18T04:51:38-07:00 List-Id: On 18 Maj, 13:29, cedric wrote: > The h-file of the api contains the following pre-processor commands: > > #ifdef SPSSXD_EXPORTS > # define SPSSXD_API __declspec(dllexport) > #else > # if MS_WINDOWS > # =A0 define SPSSXD_API __declspec(dllimport) > # else > # =A0 define SPSSXD_API > # endif > #endif > > Some functions headers are > > SPSSXD_API bool IsBackendReady(); > SPSSXD_API int SetUpFromSPSS(SpssAdapter* anAdapter, SpssXDSmb* > anSmb); > > What do I have to do to get a connection between the C functions and > my Ada program with regard to the commands of the pre-processor? Nothing, just ignore it. This crap is needed for a Visual C++ compiler which is unable to create a proper DLL otherwise (note that it has nothing to do with C++ as the programming language). Once this library is built, you should be able to interface with it from Ada as if the preprocessor magic did not exist: bool IsBackendReady(); int SetUpFromSPSS(SpssAdapter* anAdapter, SpssXDSmb* anSmb); Still, apart from importing the properly declared subprograms, you need to provide some special flag to the linker so that it can take this library into account. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com Database Access Library for Ada: www.inspirel.com/soci-ada