TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Jacob Sparre Andersen <[log in to unmask]>
Mon, 13 Aug 2001 18:46:53 +0200
TEXT/PLAIN (35 lines)
Prabhath:

> How to use gnatprep preprocessor to conditionally
> compile some part of the code in GNAT ada 95.

Why do you use `gnatprep` for this? I prefer to select the
relevant platform dependent files by "including" the
directory they are located in with the ADA_INCLUDE_PATH and
ADA_OBJECTS_PATH environment variables.

> I have tried with it, but i am not able to get rid of
> statements containing "#if" and "#end if" after
> preprocessing.

Are you sure you are looking in the right files? Hopefully,
`gnatprep` doesn't change the original files with
preprocessor directives in them, but creates new files based
on the original files and the defined symbols.

> Or is there any method to make same GNAT ada 95 code to
> run on many platforms

Generally your code should be platform independent. If you
separate the platform dependent parts in a few select
package bodies and keep them in directories named after the
platforms, you can select the platform simply by setting the
environment variables "ADA_INCLUDE_PATH" and
"ADA_OBJECTS_PATH" to point to the platform you are
targeting at the moment.

Jacob
--
http://hugin.ldraw.org/Jacob/edb/digitale_nyheder
Om redaktørens opgave på internetnyhedstjenester.

ATOM RSS1 RSS2