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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fd63afa4dc364b7e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-27 11:09:00 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!newsfeed.berkeley.edu!ucberkeley!logbridge.uoregon.edu!newsfeed.direct.ca!look.ca!btnet-peer!btnet!newspeer.clara.net!news.clara.net!dispose.news.demon.net!news.demon.co.uk!demon!zooks.demon.co.uk!anton From: Anton Gibbs Newsgroups: comp.lang.ada Subject: Re: Implementing C/C++ style #include... Date: Tue, 27 Mar 2001 19:51:56 +0100 Message-ID: References: <98m938$2iod0$1@ID-25716.news.dfncis.de> <99alrr$itf$1@nh.pace.co.uk> <99d5dj$fi4$1@nh.pace.co.uk> <99nkte$157$1@nh.pace.co.uk> NNTP-Posting-Host: zooks.demon.co.uk X-NNTP-Posting-Host: zooks.demon.co.uk:193.237.71.192 X-Trace: news.demon.co.uk 985719443 nnrp-14:13371 NO-IDENT zooks.demon.co.uk:193.237.71.192 X-Complaints-To: abuse@demon.net MIME-Version: 1.0 X-Newsreader: Turnpike Integrated Version 4.02aS Xref: supernews.google.com comp.lang.ada:6133 Date: 2001-03-27T19:51:56+01:00 List-Id: In article , Ted Dennison writes >In article , Stephen Leake says... >> >>Not this one: >> >> function Ada_Size_Of_Input is new >> Interfaces_C_More.Storage_Unit_Size_Of (Input_Type); >>#if GNAT_Compiler >> pragma Export (C, Ada_Size_Of_Input, >> "ball_ct633_ada_size_of_input", >> "ball_ct633_ada_size_of_input"); >>#elsif ObjectAda_Compiler >> pragma Export (DLL_STDCALL, Ada_Size_Of_Input, >> "ball_ct633_ada_size_of_input", >> "ball_ct633_ada_size_of_input"); >>#end if; >> >>The difference is in the name of the Convention. Preprocessing is, in >>this case, the best way to handle it. I believe the only alternative >>is to reproduce the entire package spec, and change this one value. >>Surely you do not claim that is better from a maintenance point of >>view? > >If that's the only one, perhaps. But any time you are doing a pragma Import or >Export, odds are you are doing several of them (or more). In that case, it may >*still* be better from a maintenance point of view to have two copies of the >file. >From a maintenance point of view, I think encouraging duplication of source files is a very dangerous path to take. It is never long before skewed changes creep in... One example of pre-processing we use concerns the reporting of unhandled exceptions. For our Ada83 targets we use the Telesoft (aka Alsys aka Aonix) vendor-specific System.Report_Error (there is nothing else); and for our Ada95 Targets we use the standard Ada95 features plus a bit of GNAT.Symbolic.Traceback (I think it is called). You cannot encapsulate all this in a package/procedure because the Telesoft System.Report_Error call has to be the first line in the exception handler. I would not dream of allowing two separate copies of the source file to be made in these circumstances. -- Anton Gibbs