From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: pragma/aspect Import, Convention parameters
Date: Thu, 13 Aug 2015 10:27:38 +0200
Date: 2015-08-13T10:27:38+02:00 [thread overview]
Message-ID: <1215a889y9uxf$.1nolkb1ctch79$.dlg@40tude.net> (raw)
Why is it an identifier?
For writing portable code it should be a static expression. The problem is
that much too often the exported functions of the same library have
different conventions on different platforms, e.g.
procedure Foo ...
pragma Import (C, Foo, "Foo"); -- Linux
procedure Foo ...
pragma Import (StdCall, Foo, "_Foo"); -- Windows
The external name is an expression. Thus you could write something like
pragma Import (..., Foo, Target.External_Name_Prefix & "Foo");
With External_Name_Prefix defined in a single configuration packet Target
to change. But the convention is not an expression.
There certainly are ways to keep it backward compatible, e.g.
procedure Foo ...
pragma Import (User, Foo, "Foo", "Stdcall");
procedure Foo ... with Convention_Name => "StdCall", ...
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next reply other threads:[~2015-08-13 8:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-13 8:27 Dmitry A. Kazakov [this message]
2015-08-13 10:24 ` pragma/aspect Import, Convention parameters 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
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