comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: pragma/aspect Import, Convention parameters
Date: Fri, 14 Aug 2015 09:23:25 +0200
Date: 2015-08-14T09:23:25+02:00	[thread overview]
Message-ID: <1xhfjepw437zd.137i8eiplc5lt.dlg@40tude.net> (raw)
In-Reply-To: mqiuso$m0g$1@loke.gir.dk

On Thu, 13 Aug 2015 15:32:23 -0500, Randy Brukardt wrote:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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


  reply	other threads:[~2015-08-14  7:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13  8:27 pragma/aspect Import, Convention parameters Dmitry A. Kazakov
2015-08-13 10:24 ` G.B.
2015-08-13 11:52   ` Dmitry A. Kazakov
2015-08-13 20:32 ` Randy Brukardt
2015-08-14  7:23   ` Dmitry A. Kazakov [this message]
2015-08-14 20:30     ` Randy Brukardt
2015-08-15  1:15       ` Shark8
2015-08-17 21:40         ` Randy Brukardt
2015-08-17 21:47           ` Bob Duff
2015-08-20 16:00           ` Shark8
2015-08-13 23:42 ` David Botton
2015-08-15  5:22   ` gautier_niouzes
2015-08-17 21:54     ` Randy Brukardt
2015-08-20 16:07       ` Shark8
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox