Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Does Ada have a preprocessor?

ADA preprocessor
0
Posted

Does Ada have a preprocessor?

0

The answer to your question is no, Ada does not have a pre-processor that is built into the language. That means each compiler may or may not have one and there is not “uniform” syntax for pre-processing and things like conditional compilation. This was intentional: it’s considered “harmful” to the Ada ethos. There are almost always ways around a lack of a preprocessor but often times the solution can be a little cumbersome. For example, you can declare the platform specific functions as ‘separate’ and then use build-tools to compile the correct one (either a project system, using pragma body replacement, or a very simple directory system… put all the windows files in /windows/ and all the linux files in /linux/ and include the appropriate directory for the platform). All that being said, GNAT realized that sometimes you need a preprocessor and has created gnatprep. It should work regardless of the compiler (but you will need to insert it into your build process). Similarly, for simp

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.