comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen.adalog@wanadoo.fr>
Subject: Re: ifdef replacement for GNAT
Date: 1998/04/14
Date: 1998-04-14T00:00:00+00:00	[thread overview]
Message-ID: <6gv6l3$73e$1@peuplier.wanadoo.fr> (raw)
In-Reply-To: dewar.892261504@merv


Robert Dewar a �crit dans le message ...
>Dirk asks
>
><<How is an Ada project (GNAT) being kept portable among various Unices
>and say, Win32? Assume there is something special to be done in all
>environments. Without using a nonstandard tool like gnatprep that is.
>>>
>
>The Steelman requirements prohibited the inclusion of preprocessing in
>the Ada language, which may surprise you. What may surprise you more is
>that I and many others think this is a *good thing*.
>
>We provide gnatprep for our users, but we do NOT use it ourselves in
>the GNAT system.
>
>The proper approach for achieving target dependence is to follow two steps
>
>  (a) encapsulte the target dependence down to the minimum level
>
>  (b) Provide separate target dependent units for these remaining functions
>

Note that library packages renaming can be handy in managing this approach.
You define for example:

package My_Interface_Unix is...
package My_Interface_Win32 is...

and then:
with My_Interface_Win32;
package My_Interface renames My_Interface_Win32;

and use My_Interface all over the place.

If you change operating system, you only need to change the renaming in only
one place. Not more work than changing a #define.
--
----------------------------------------------------------------------------
                  J-P. Rosen (Rosen.Adalog@wanadoo.fr)
      Visit Adalog's web site at http://perso.wanadoo.fr/adalog






  parent reply	other threads:[~1998-04-14  0:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <352287EE.1CFB@tolstoy.mdc.com>
1998-04-08  0:00 ` ifdef replacement for GNAT John T Vegezzi 312C M 237110
1998-04-09  0:00   ` Robert Dewar
1998-04-10  0:00     ` Dirk Zoller
1998-04-10  0:00       ` Robert Dewar
1998-04-11  0:00         ` nabbasi
1998-04-11  0:00           ` Larry Kilgallen
1998-04-13  0:00           ` Richard Kenner
1998-04-11  0:00         ` Larry Kilgallen
1998-04-11  0:00         ` raw
1998-04-13  0:00         ` Michael F Brenner
1998-04-13  0:00           ` Larry Kilgallen
1998-04-15  0:00             ` Ada Programming Environment [was ifdef replacement for GNAT] Nick Roberts
1998-04-14  0:00         ` Jean-Pierre Rosen [this message]
1998-04-11  0:00       ` ifdef replacement for GNAT Geert Bosch
1998-04-12  0:00         ` Haug Buerger
1998-04-13  0:00           ` Aaro Koskinen
replies disabled

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