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,be6e28f854440947 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: How to get the mouse position with JEWL? Date: Fri, 22 Oct 2010 00:39:22 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: <1dbwvwvv5nn1h.1s4mepzsbnf54.dlg@40tude.net> NNTP-Posting-Host: J4HSNf9Eqj44wTz1J3b8lQ.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Tom's custom newsreader Xref: g2news2.google.com comp.lang.ada:15638 Date: 2010-10-22T00:39:22+00:00 List-Id: > > 3. My copy of win32.ads declares > > subtype PVOID is System.Address; > > System.Address is not the same as an access value to my preferred Ada > > compiler. > > But PVOID is an address, if an Ada's access type is not, then it cannot be > used for PVOID. An "address" on a Wintel architecture is a segment and an offset. (remember memory models?) So Janus Ada's System.Address is a segment and an offset. PVOID is a C pointer, which is only an offset, the same as an Ada access value in Janus Ada. > > 4. I also note that my copy of win32-windef.ads says, in the private part, > > pragma Convention(C_Pass_By_Copy, POINT); > > which would of course make Jeffrey Carter's suggestion fail. > > The possibility of surprises like that makes me leary. > > It only means that this win32ada (the AdaCore's one?) cannot be used with > your compiler. Win32 bindings are not necessarily portable across different > Ada compilers. The C_Pass_By_Copy on POINT would make a function call with an "in" parameter of Point pass in the POINT data, not a pointer to the data as Carter's suggestion assumes. That should be true of any Ada compiler. But your main point, that win32ada is not portable and locks you into certain compilers, is definitely true. (I recall that making CLAW portable across multiple Ada compilers required significant care.)