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=unavailable autolearn_force=no version=3.4.4 Path: border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: spec/body/rep (Was: Compilation error (GNAT bug?)) Date: Tue, 27 May 2014 07:16:56 +0200 Organization: A noiseless patient Spider Message-ID: References: <537bd591$0$6621$9b4e6d93@newsspool4.arcor-online.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 27 May 2014 05:16:56 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="2b3884a634d8f846e0712b4e3a92507a"; logging-data="1721"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+TsRzgFxTmywxyw81Ph+EF" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: Cancel-Lock: sha1:meaVjSJOl2+EE0TD0NUqDnyx4Eg= X-Enigmail-Version: 1.6 Xref: number.nntp.dca.giganews.com comp.lang.ada:186636 Date: 2014-05-27T07:16:56+02:00 List-Id: 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