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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c35edbbda4c7f58f,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!t-online.de!news.task.gda.pl!not-for-mail From: jtg Newsgroups: comp.lang.ada Subject: Conditional compilation in Ada? Date: Tue, 16 Nov 2004 19:30:39 +0100 Organization: CI TASK http://www.task.gda.pl Message-ID: NNTP-Posting-Host: pwr74.pwradio.pl Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: korweta.task.gda.pl 1100629789 9734 153.19.176.74 (16 Nov 2004 18:29:49 GMT) X-Complaints-To: abuse@news.task.gda.pl NNTP-Posting-Date: Tue, 16 Nov 2004 18:29:49 +0000 (UTC) X-Original-Organization: CI TASK http://www.task.gda.pl X-Accept-Language: pl, en-us, en User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.3) Gecko/20040910 X-Organization-Notice: Organization line has been filtered Xref: g2news1.google.com comp.lang.ada:6221 Date: 2004-11-16T19:30:39+01:00 List-Id: I am using Ada for many years now, but recently I stumbled upon a problem I cannot solve: I need some kind of conditional preprocessing, which is commonly used in C programs: #ifdef CONDITION (some source code) #else (other source code) #endif How to achieve it with Ada? I am developing two applications which are very similar and share the same source code. The only difference is a small change in a fundamental data structure. Both versions of the data structure are mostly handled the same way (within thousands of lines of source code), but there are some 10 or 20 (number still growing) places where minor changes are necessary. What is worse, during the development every several hours I have to prepare and run both the applications. To do this, I have to perform "human preprocessing": find those places, comment lines for app1, and uncomment lines for app2. This is very error prone and I have already made a mistake. Any hints?