comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: spec/body/rep (Was: Compilation error (GNAT bug?))
Date: Tue, 27 May 2014 07:16:56 +0200
Date: 2014-05-27T07:16:56+02:00	[thread overview]
Message-ID: <lm1748$1lp$1@dont-email.me> (raw)
In-Reply-To: <lm06or$b58$1@loke.gir.dk>

Le 23/05/2014 23:21, Randy Brukardt a écrit :
> I don't think so, mainly because you already have such a capability: 
> constants! It's not the presence or absence of an aspect that changes, it's 
> the value. So it might make sense to have a package specifically for the 
> target-specific details (many systems do that, including the ACATS).
> 
> For instance:
>     package Target_Specific is
>          -- Package for Windows.
>          pragma Linker_Options (...);
> 
>          -- Data types:
>          type Largest_Integer is range -2**31 .. 2**31 with Size => 32;
>          type Largest_Modular is mod 2**32 with Size => 32;
> 
>          -- Interfacing details for package Blarch:
>          Foo_External_Name : constant String := "...";
>          Bar_External_Name : constant String := "...";
> 
>          ...
>    end Target_Specific;
> 
> And then have separate versions of the package for the various targets 
> supported.
And to ease porting, have a package called Target_Specific_Windows,
another one called Target_Specific_Linux. All the users do:
with Target_Specific;

and have the following library-lever renaming:
with Target_Specific_Windows;
package Target_Specific renames Target_Specific_Windows;


-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr


  reply	other threads:[~2014-05-27  5:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20 18:32 Compilation error (GNAT bug?) Victor Porton
2014-05-20 18:43 ` Simon Wright
2014-05-20 22:22   ` spec/body/rep (Was: Compilation error (GNAT bug?)) Georg Bauhaus
2014-05-23 21:21     ` Randy Brukardt
2014-05-27  5:16       ` J-P. Rosen [this message]
2014-05-27  6:22         ` Niklas Holsti
2014-05-27  8:54           ` J-P. Rosen
2014-05-27  8:55           ` Dmitry A. Kazakov
2014-05-27 15:45             ` G.B.
2014-05-27 16:41               ` Dmitry A. Kazakov
2014-05-27 16:52                 ` G.B.
2014-05-27 17:03                   ` Dmitry A. Kazakov
2014-05-27 22:57               ` Randy Brukardt
replies disabled

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