comp.lang.ada
 help / color / mirror / Atom feed
From: Jerry <lanceboyle@qwest.net>
Subject: Re: Pragma for conditional compilation? (Ada 2005 vs. 95)
Date: Thu, 27 Sep 2007 14:46:10 -0700
Date: 2007-09-27T14:46:10-07:00	[thread overview]
Message-ID: <1190929570.915553.284000@19g2000hsx.googlegroups.com> (raw)
In-Reply-To: <XYPKi.143875$ax1.97469@bgtnsc05-news.ops.worldnet.att.net>

On Sep 27, 8:26 am, a...@anon.org (anon) wrote:

Thanks, anon, for the detailed answer.

>
> The third real old way is to code in the option by a "IF-THEN-ELSE-END"
> statements and use a Global constant variable(s). Its low tech but it
> still works.

OK, but my "problem" is in declaring types which I want to be visible
in 95 but not visible in 05, as 05 provides them itself. An "IF-THEN-
ELSE-END" solution would have to be in the executable part of the
program (right?).


> The fifth is a "NON STANDARD" way that GNAT introduce with the
> pre-release of Ada_2005 which is to use the "pragma Ada_05 ( name ) ;"
>
> Example:
>
> -- For GNAT you can create a routine that is define and is usable
> -- only in Ada_2005 specs, by using the GNAT pragma Ada_05.
> --
> -- Gnat uses this concept in the  Ada.Text_IO package. Just
> -- search for "Ada_05" in the file "a-textio.ads". There are
> -- two Get_Line functions. If the system is compiled with
> -- "pragma Ada_83 ;" or "pragma Ada_95" the compile will not
> -- allow a call to these routines. But under Ada_05 the routine is
> -- visible.
> --
> -- Defined in the specification file.
>
>    procedure Routine ;
>    pragma Ada_05 ( Routine ) ;
>
> --
> -- Defined in the body file.
> --
>    procedure Routine is
>      begin -- Routine
>         null ;
>      end Routine ;
>
Same comment as above--how would this work for type declarations?
Could I follow the type declaration with the pragma? Also, I need to
conditionally have a with clause. For example, if using Ada 2005, I
need a line like this:

  with Ada.Numerics.Long_Real_Arrays;
  use  Ada.Numerics.Long_Real_Arrays;

(This is where the vector and matrix declarations are.)

Jerry





  reply	other threads:[~2007-09-27 21:46 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-27  7:56 Pragma for conditional compilation? (Ada 2005 vs. 95) Jerry
2007-09-27  9:31 ` Georg Bauhaus
2007-09-27 16:59   ` Pascal Obry
2007-09-27 21:56     ` Jerry
2007-09-27  9:52 ` Stephen Leake
2007-09-27  9:58 ` Brian Drummond
2007-09-27 15:26 ` anon
2007-09-27 21:46   ` Jerry [this message]
2007-09-28  4:55     ` Jeffrey R. Carter
2007-09-28 12:15       ` Jeffrey Creem
2007-09-28 14:06         ` Jean-Pierre Rosen
2007-09-28 15:24           ` Ludovic Brenta
2007-09-28 16:08             ` Jean-Pierre Rosen
2007-09-28 17:54               ` Georg Bauhaus
2007-09-28 18:19                 ` Pascal Obry
2007-09-28 20:02                   ` Stefan Bellon
2007-09-28 20:14                     ` Pascal Obry
2007-09-28 20:26                       ` Stefan Bellon
2007-09-29 10:24                     ` Stephen Leake
2007-09-28 20:04                   ` Simon Wright
2007-09-28 20:11                     ` Pascal Obry
2007-09-29 10:29                     ` Stephen Leake
2007-09-29 10:18               ` Stephen Leake
2007-09-28 18:07     ` anon
2007-09-29 22:13 ` Jerry
2007-09-30 10:54   ` Stephen Leake
replies disabled

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