comp.lang.ada
 help / color / mirror / Atom feed
From: sjw <simon.j.wright@mac.com>
Subject: Re: Conditional Compilation in Ada
Date: Mon, 29 Jun 2009 13:02:32 -0700 (PDT)
Date: 2009-06-29T13:02:32-07:00	[thread overview]
Message-ID: <abbb1d04-ed1b-422b-8c83-85b69c0f1a4b@t21g2000yqi.googlegroups.com> (raw)
In-Reply-To: d6acda9e-09f6-45fe-80c0-07282191ae0c@t13g2000yqt.googlegroups.com

On Jun 29, 7:00 pm, Chrono <pablit...@gmail.com> wrote:

> Well, creating folders for each scenario is definitely not a better
> solution than using a prep script, mainly in a project with high
> complexity in its architecture. Even creating new packages for doing
> this (or new variables which are going to be compiled with main code),
> due to requirements restrictions. But thanks even though for all
> responses.

Gosh, how many scenario variables do you have? with how many options?
I bet they don't actually affect that many actual code units,
especially if structured the way Dmitry suggests.

You could use alternately-named bodies:

project T is
  type Environment is ("Real", "Simulated");
  Env : Environment := external ("ENVIRONMENT");
  package Naming is
     case Env is
        when "Real" =>
           for body ("Target.Get_Position")
             use "target-get_position_real.adb";
        when "Simulated" =>
           for body ("Target.Get_Position")
             use "target-get_position_simulated.adb";
     end case;
  end Naming;
end T;

--S



  reply	other threads:[~2009-06-29 20:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-29 11:10 Conditional Compilation in Ada Pablo
2009-06-29 11:42 ` sjw
2009-06-29 12:01   ` Chrono
2009-06-29 12:30     ` Dmitry A. Kazakov
2009-06-29 12:15   ` sjw
2009-06-29 18:00     ` Chrono
2009-06-29 20:02       ` sjw [this message]
2009-06-30 10:41         ` Chrono
2009-06-29 20:13       ` Robert A Duff
2009-06-30 15:39 ` Per Sandberg
2009-06-30 17:03   ` Chrono
2009-06-30 20:09   ` sjw
2009-06-30 20:15   ` sjw
2009-07-01 16:20     ` Per Sandberg
2009-07-01  0:18 ` anon
replies disabled

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