comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: StdCall and pragma Import_Function
Date: Fri, 19 Aug 2011 13:45:27 -0700
Date: 2011-08-19T13:45:27-07:00	[thread overview]
Message-ID: <j2mi2t$vfu$1@tornado.tornevall.net> (raw)
In-Reply-To: <51f8a92b-41b2-4d57-914e-a326163adc9f@glegroupsg2000goo.googlegroups.com>

On 08/19/2011 01:07 PM, Felix Krause wrote:
>
> typedef unsigned __int64 cl_ulong;
> typedef cl_ulong cl_bitfield;
> typedef cl_bitfield cl_device_type;

So what is expected by the C is an unsigned 64-bit integer, not a 64-bit record 
with 2 1-bit fields. Another rule I use when interfacing with C is, when it is 
more meaningful in Ada to use a different kind of type from that used by C, to 
use the Ada equivalent of the C type and convert to and from the more meaningful 
Ada type, (The conversions should, of course, be hidden from the client of your 
interface.) This seems to be your work around to passing the record, so I guess 
you're good to go.

-- 
Jeff Carter
"Your mother was a hamster and your father smelt of elderberries."
Monty Python & the Holy Grail
06



  parent reply	other threads:[~2011-08-19 20:45 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 [this message]
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
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