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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,73975695cdfcb86f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.202.168 with SMTP id kj8mr12961819pbc.1.1333539647550; Wed, 04 Apr 2012 04:40:47 -0700 (PDT) Path: r9ni17390pbh.0!nntp.google.com!news1.google.com!postnews.google.com!k24g2000yqe.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Dispatching callback handed over to C Date: Wed, 4 Apr 2012 04:34:20 -0700 (PDT) Organization: http://groups.google.com Message-ID: <62246369-6b9f-4a96-9c67-fd1774c02e78@k24g2000yqe.googlegroups.com> References: <6fb83c74-b2a4-4ae8-9c89-d755b737198f@v22g2000vby.googlegroups.com> <85d1ad51-c02b-44fa-87b6-02aa1d8ba1b2@x17g2000vba.googlegroups.com> NNTP-Posting-Host: 213.77.7.66 Mime-Version: 1.0 X-Trace: posting.google.com 1333539647 16792 127.0.0.1 (4 Apr 2012 11:40:47 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 4 Apr 2012 11:40:47 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k24g2000yqe.googlegroups.com; posting-host=213.77.7.66; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-Via: 1.1 localhost (squid/3.1.6) X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-04-04T04:34:20-07:00 List-Id: On 3 Kwi, 22:20, "Randy Brukardt" wrote: > The basic idea is that System.Address ought to be able to access any memory > on the target that might have hardware located at it. Interestingly, this is also the intent of void*. > Matching the C compiler is irrelevant; we have access > types and convention C for that purpose This is almost true. The problem is that AARM gives no provisions whatsoever to pass access to class-wide types (only types that have "corresponding C types" are covered) to or from C and the ability to do it seems to be essential in the OO context. That is, there is no direct way to be standard- compliant here. Note that in my solution the access to class-wide is passed to C++ and back only for storage - the actual use (the dispatching call) is at the Ada side, so the mechanics used for that storage need to only ensure that the physical representation of access value is retained. System.Address with void* do it properly on my platform. Using a string representation might be a possible solution, too, even if potentially slower. That it does not work on your compiler? Count it as my feature request, then. ;-) -- Maciej Sobczak * http://www.inspirel.com