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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: pragma/aspect Import, Convention parameters Date: Fri, 14 Aug 2015 09:23:25 +0200 Organization: cbb software GmbH Message-ID: <1xhfjepw437zd.137i8eiplc5lt.dlg@40tude.net> References: <1215a889y9uxf$.1nolkb1ctch79$.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: enOx0b+nfqkc2k+TNpOejg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:27445 Date: 2015-08-14T09:23:25+02:00 List-Id: On Thu, 13 Aug 2015 15:32:23 -0500, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:1215a889y9uxf$.1nolkb1ctch79$.dlg@40tude.net... >> Why is it an identifier? > > Dunno. That's what Ada 95 defined, and we've never had a request to change > it. Maybe now? It is not a big change and as much as I hate if-then-else expressions they could be handy here. > In my experience (which is mostly with rather low-level stuff), there is a > lot more different than just the convention when changing between Linux and > Windows (subprogram names, parameter values, etc.) In these days most upper level libraries are more or less compatible regarding their API. The main problem is actually names and conventions because most of them have them build with Visual C for the Windows part and mimic Windows API, which are StdCall. > So it's not much of a > hardship to use separate thin bindings for each -- the differences are > reconciled in the thick binding anyway. Keeping two versions of *.ads is excessive and a hell of maintenance. Independently of whether you have thick bindings or not, you have to have thin bindings first. > The problem with such an approach is that conventional version control > doesn't work very well with it; one needs to control individual blocks with > some different and many being shared. Ideally, changes in shared parts would > be reflected in all of the related versions of each package, while changes > in the unshared parts would not. Yes, that is the problem. The Ada bindings sources are practically same up to the pragma Import part. > We side-stepped the problem for Claw by not supporting any other targets > than Windows. :-) It would have been a lot worse had we wanted to support > (say) GTK on Linux. Yes. However GTK is not a big problem because it has same external names under Windows and Linux. For really few exceptions GTK's GIO had I used GCC linker weak references to avoid contamination of *.ads files. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de