comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: StdCall and pragma Import_Function
Date: Fri, 19 Aug 2011 10:26:01 -0700 (PDT)
Date: 2011-08-19T10:26:01-07:00	[thread overview]
Message-ID: <090a4db0-d67c-4dfe-9d67-24b2edc3b392@r40g2000prf.googlegroups.com> (raw)
In-Reply-To: 118ybwhr53151$.fjqabmpo2k23$.dlg@40tude.net

On Aug 19, 9:51 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> On Fri, 19 Aug 2011 09:24:33 -0700 (PDT), Felix Krause wrote:
> >    pragma Import (StdCall, C_Function, "cFunc");
> >    pragma Import_Function (Internal => C_Function, External => "cFunc", Mechanism => (Param => Value));
> > end P;
>
> Stdcall is the calling convention used by Windows API.  If you want to call
> a C function then most likely it rather should be C, i.e.
>
>    pragma Import (C, ...);

The OP did say that the symbol name _cFunc@8 exists in the library,
which indicates that using StdCall appears to be correct, just that
GNAT is using the wrong size for the symbol.

Offhand, this looks like a bug, but there may be some other legitimate
reason why GNAT isn't getting the size right, and I'm not familiar
enough with GNAT-specific pragmas to be of any more help.  Out of
curiosity, Felix, what happens if you add a 62-bit "filler" field to
Bit_Vector, with 2..63 in the representation clause?  Does that make
things work?

                                   -- Adam



  parent reply	other threads:[~2011-08-19 17:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-19 16:24 StdCall and pragma Import_Function Felix Krause
2011-08-19 16:51 ` Dmitry A. Kazakov
2011-08-19 17:07   ` Felix Krause
2011-08-19 18:58     ` Dmitry A. Kazakov
2011-08-19 19:23       ` Felix Krause
2011-08-19 19:43         ` Dmitry A. Kazakov
2011-08-19 20:07           ` Felix Krause
2011-08-19 20:37             ` Dmitry A. Kazakov
2011-08-19 20:45             ` Jeffrey Carter
2011-08-21 18:25               ` Felix Krause
2011-08-20  8:04           ` Georg Bauhaus
2011-08-20  9:23             ` Dmitry A. Kazakov
2011-08-19 17:26   ` Adam Beneschan [this message]
2011-08-19 17:38     ` Felix Krause
2011-08-19 18:10 ` Jeffrey Carter
2011-08-19 18:37   ` Felix Krause
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox