From: Stephen Leake <Stephen.Leake@gsfc.nasa.gov>
Subject: Re: Text control characters
Date: 1997/09/12
Date: 1997-09-12T00:00:00+00:00 [thread overview]
Message-ID: <341954D6.162C@gsfc.nasa.gov> (raw)
In-Reply-To: 5v9vj1$dge$1@goanna.cs.rmit.edu.au
Dale Stanbrough wrote:
>
> package Unix.Line_Terminators is
> Line_Terminator : constant String := Ascii.LF & "";
>
> end;
>
> with Unix.Line_Terminators;
> package OS.Line_Terminators is
>
> Line_Terminator : String renames Unix.Line_Terminators.Line_Terminator;
>
> end;
>
> and then get your configuration system to choose the appropriate with
> (maybe even use a preprocessor! to select a with statement).
>
> Thinking about it, the preprocessor selection of a with statement
> would seem to be a fairly benign use of preprocessors. Can anyone see
> any great harm in this scheme?
you don't need a preprocessor; you can set things up so only the BODY of
the package is OS dependent, and let the CM system choose which FILE to
use for the body:
file os-line_terminator.ads:
--------------------
package OS.Line_Terminators is
function Line_Terminator return String;
end OS.Line_Terminators;
--------------------
file os-line_terminator__aix432.adb:
--------------------
package body OS.Line_Terminators is
-- this is for AIX 4.3.2
function Line_Terminator return String is
begin
return "" & Ascii.LF;
end Line_terminator;
end OS.Line_Terminators;
--------------------
Under GNAT, since we're not using the conventional name for the body
file, we need a configuration pragma:
file gnat.adc:
--------------------
pragma Source_File_Name (OS.Line_Terminators,
BODY_FILE_NAME =>
"os-line_terminator__aix432.adb");
--------------------
other compilers will have other ways of specifying which file contains
which
compilation unit.
--
- Stephe
next prev parent reply other threads:[~1997-09-12 0:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-09-10 0:00 Text control characters John Woodruff
1997-09-11 0:00 ` Dale Stanbrough
1997-09-12 0:00 ` Robert A Duff
1997-09-15 0:00 ` Larry Kilgallen
1997-09-12 0:00 ` Stephen Leake [this message]
1997-09-12 0:00 ` Robert A Duff
1997-09-13 0:00 ` Tarjei T. Jensen
1997-09-11 0:00 ` Anonymous
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox