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,39ade949adb6bf4 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!goblin1!goblin.stu.neva.ru!news.tornevall.net!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: StdCall and pragma Import_Function Date: Fri, 19 Aug 2011 13:45:27 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: <332032a4-0acf-459d-a743-e90e823ca5af@glegroupsg2000goo.googlegroups.com> <118ybwhr53151$.fjqabmpo2k23$.dlg@40tude.net> <3feb634f-ca38-4f08-a6da-5299233f295e@glegroupsg2000goo.googlegroups.com> <11f8n1nxhs0hg$.16p4wm0m6u4nt.dlg@40tude.net> <1je5iuczb7anp.1vt48byg9dio7$.dlg@40tude.net> <51f8a92b-41b2-4d57-914e-a326163adc9f@glegroupsg2000goo.googlegroups.com> NNTP-Posting-Host: bc6eeea168574c13026ed058ae0d3d51 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: 6a3182ae3436768ffb23ba77141e4329 X-Complaints-To: abuse@tornevall.net User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: <51f8a92b-41b2-4d57-914e-a326163adc9f@glegroupsg2000goo.googlegroups.com> X-UserIDNumber: 1738 X-Validate-Post: http://news.tornevall.net/validate.php?trace=6a3182ae3436768ffb23ba77141e4329 X-Complaints-Italiano: Non abbiamo padronanza della lingua italiana - se mandate una email scrivete solo in Inglese, grazie X-Posting-User: 0243687135df8c4b260dd4a9a93c79bd Xref: g2news1.google.com comp.lang.ada:20692 Date: 2011-08-19T13:45:27-07:00 List-Id: 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