comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Interfacing with C
Date: Mon, 18 May 2009 04:51:38 -0700 (PDT)
Date: 2009-05-18T04:51:38-07:00	[thread overview]
Message-ID: <4395a113-28cc-4a34-bcd3-c05da82872fa@z19g2000vbz.googlegroups.com> (raw)
In-Reply-To: 250d9b93-13bf-4375-8b35-a1b0a7f74d99@j12g2000vbl.googlegroups.com

On 18 Maj, 13:29, cedric <c.lann...@web.de> 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
> #   define SPSSXD_API __declspec(dllimport)
> # else
> #   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



  reply	other threads:[~2009-05-18 11:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-18 11:29 Interfacing with C cedric
2009-05-18 11:51 ` Maciej Sobczak [this message]
2009-05-18 11:58 ` Dmitry A. Kazakov
2009-05-18 12:11   ` Ludovic Brenta
2009-05-18 12:13     ` Ludovic Brenta
2009-06-01  8:24   ` David Thompson
     [not found] <vhiln6cllz7.fsf@grotte.ifi.uio.no>
1999-12-30  0:00 ` Simon Wright
1999-12-31  0:00 ` Jerry van Dijk
1999-12-31  0:00   ` Simon Wright
     [not found] <7rtlav$bm7$1@nnrp1.deja.com>
     [not found] ` <37e2b0e7.0@news.pacifier.com>
1999-09-22  0:00   ` Richard D Riehle
1999-09-22  0:00     ` Ted Dennison
1999-09-22  0:00       ` David Botton
1999-09-23  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