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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6426898aedaa5880 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!19g2000hsx.googlegroups.com!not-for-mail From: Jerry Newsgroups: comp.lang.ada Subject: Re: Pragma for conditional compilation? (Ada 2005 vs. 95) Date: Thu, 27 Sep 2007 14:46:10 -0700 Organization: http://groups.google.com Message-ID: <1190929570.915553.284000@19g2000hsx.googlegroups.com> References: <1190879769.361848.188220@22g2000hsm.googlegroups.com> NNTP-Posting-Host: 75.171.63.196 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1190929572 3851 127.0.0.1 (27 Sep 2007 21:46:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 27 Sep 2007 21:46:12 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/522+ (KHTML, like Gecko, Safari/522) OmniWeb/v612.0.91344,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: 19g2000hsx.googlegroups.com; posting-host=75.171.63.196; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:2171 Date: 2007-09-27T14:46:10-07:00 List-Id: 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