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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,WEIRD_QUOTING autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!g1g2000yqh.googlegroups.com!not-for-mail From: Chrono Newsgroups: comp.lang.ada Subject: Re: Conditional Compilation in Ada Date: Tue, 30 Jun 2009 10:03:35 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <5618a901-6b05-4a60-8362-7821261da50b@f19g2000yqo.googlegroups.com> NNTP-Posting-Host: 201.7.145.1 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1246381415 29590 127.0.0.1 (30 Jun 2009 17:03:35 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 30 Jun 2009 17:03:35 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: g1g2000yqh.googlegroups.com; posting-host=201.7.145.1; posting-account=n9Sa1woAAACZc_iwSjaEkj9Lnt-XVrSr User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6764 Date: 2009-06-30T10:03:35-07:00 List-Id: On 30 jun, 12:39, Per Sandberg wrote: > After all discussions her are a solution for conditinal compilation > using GNAT: > ------------------------------------------------ > project Fools is > =A0 =A0 type Dumb_Type is ("""JustStupid""", """Idiot""", """Fool"""); > =A0 =A0 Dumb : Dumb_Type :=3D external ("DUMB", """Fool"""); > > =A0 =A0 package Compiler is > =A0 =A0 =A0 =A0for Default_Switches ("ada") use > =A0 =A0 =A0 =A0 =A0("-gnateDDUMB=3D" & Dumb); > =A0 =A0 end Compiler; > end Fools ; > ------------------------------------------------ > package Fools =A0is > #if DUMB=3D """Idiot""" then > =A0 =A0 a : Integer :=3D 100; > #else > =A0 =A0 a : integer :=3D 20; > #end if; > =A0 =A0 b : constant String :=3D $DUMB; > end Fools ; > ------------------------------------------------ > with ada.Text_IO; > procedure Fools.main is > begin > =A0 =A0 Ada.Text_IO.Put_Line(B & " -> "&a'img); > end Fools.main; > ------------------------------------------------ > /Ugly but it works > /Per > > Pablo wrote: > > Hi, does someone know how to make conditional compilation in Ada with > > Scenarios? Say, I need to hide from compilation a part of an Ada code > > in some Scenario mode. > > LOL!! It was exactly what I wanted!! Thanks very much, Per.