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,WEIRD_QUOTING autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,80155a886d197693 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!feeder.news-service.com!cyclone02.ams2.highwinds-media.com!news.highwinds-media.com!npeersf01.ams.highwinds-media.com!newsfe15.ams2.POSTED!40385e62!not-for-mail From: Per Sandberg User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Conditional Compilation in Ada References: <5618a901-6b05-4a60-8362-7821261da50b@f19g2000yqo.googlegroups.com> In-Reply-To: <5618a901-6b05-4a60-8362-7821261da50b@f19g2000yqo.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: abuse@WWWSpace.NET NNTP-Posting-Date: Tue, 30 Jun 2009 16:34:33 UTC Date: Tue, 30 Jun 2009 17:39:20 +0200 Xref: g2news2.google.com comp.lang.ada:6762 Date: 2009-06-30T17:39:20+02:00 List-Id: After all discussions her are a solution for conditinal compilation using GNAT: ------------------------------------------------ project Fools is type Dumb_Type is ("""JustStupid""", """Idiot""", """Fool"""); Dumb : Dumb_Type := external ("DUMB", """Fool"""); package Compiler is for Default_Switches ("ada") use ("-gnateDDUMB=" & Dumb); end Compiler; end Fools ; ------------------------------------------------ package Fools is #if DUMB= """Idiot""" then a : Integer := 100; #else a : integer := 20; #end if; b : constant String := $DUMB; end Fools ; ------------------------------------------------ with ada.Text_IO; procedure Fools.main is begin 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.