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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.swapon.de!feeder.erje.net!eu.feeder.erje.net!lightspeed.eweka.nl!eweka.nl!post.eweka.nl!post.eweka.nl!not-for-mail From: Felix Krause Newsgroups: comp.lang.ada Date: Fri, 6 Dec 2013 21:48:43 +0100 Message-ID: <52a2382a$0$7939$2c885b36@post.eweka.nl> References: <52a0de7e$0$23162$2c885b36@post.eweka.nl> <2Kiou.15508$bz3.2509@fx24.fr7> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: Exclude parts of a package User-Agent: Unison/2.1.10 Organization: Eweka Internet Services NNTP-Posting-Host: Eweka Internet Services X-Complaints-To: abuse@n-o-s-p-a-m.eweka.nl Xref: news.eternal-september.org comp.lang.ada:17881 Date: 2013-12-06T21:48:43+01:00 List-Id: On 2013-12-06 11:41:50 +0000, Brian Drummond said: > > I would tend to avoid the preprocessor - even the Gnat one - if at all > possible. > > The basic idea is to separate out variant functionality into different > packages for each revision - maybe OpenCL_1_0, OpenCL_1_1, etc. > > Then with/use a base package, OpenCL, in all your application code. > > When you come to build the program, you create the package OpenCL > appropriately : it can be as simple as: > > with OpenCL_1_1; > package Open_CL renames OpenCL_1_1; > > [snip] This is an interesting approach, but in my case, that would lead to massive code duplication because I don't really have child packages to choose from (same goes for having multiple spec files). I rather need to add or exclude subroutines of one package. Moving it to a child package will not work because it needs to be a primitive operation of a tagged type defined in the original package. Pragma Unimplemented_Unit is interesting, using gnatprep seems to be even cleaner to me because it actually strips the declaration from the package specification. As gnatprep is pretty independent from the GNAT compiler, I think this is a good compromise between portability and clean code. Thanks everyone! -- Felix Krause http://flyx.org/