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,74bc23dcb20218db X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!feeder.erje.net!news2.arglkargh.de!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: How to access this package written in C? Date: Tue, 27 Apr 2010 17:29:14 -0500 Organization: Jacob Sparre Andersen Message-ID: References: <4e9d2aaf-c0a6-4798-b838-8f5b7c4a39d1@k33g2000yqc.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1272407354 450 69.95.181.76 (27 Apr 2010 22:29:14 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 27 Apr 2010 22:29:14 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-RFC2646: Format=Flowed; Original Xref: g2news1.google.com comp.lang.ada:10247 Date: 2010-04-27T17:29:14-05:00 List-Id: ... >> I use this: >> >> subtype Void_Ptr is System.Address; > > I have sometimes used > > type Void is null record; > pragma Convention (Void, C); > type Void_Ptr is access all Void; > pragma Convention (Void_Ptr, C); Most of the time, I've avoided any version of void* and simply written overloadings for each type that I needed (using in out parameters if possible, or access parameters if I needed the function result). That only works of course when the number of types that you need is limited, and it's not as flexible as some more direct mapping. But void* is exactly the opposite of strong typing, and it simply doesn't fit well into the Ada type model. So avoiding it if possible is the best approach. Randy.