Re: Discriminating Ada source code through compiler arguments



ada_develop a écrit :
> Hello. I´m a newie in Ada and I want to known how can I pass arguments
> to the compiler to discriminate parts of a Ada source code. Something
> like the #ifdefs that we can use in the C programming languaje.

This really depends on your compiler. There is not standard for doing
this in Ada. Note that this is by design, #ifdef is considered bad
practice and a maintenance nightmare!

If you are using GNAT you can check gnatprep.

But a better solution is often to have one spec and multiple bodies for
different implementations. But without knowing more about your goal it
is difficult to devise the solution.

Pascal.

--

--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
.



Relevant Pages