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-26 11:20:08 PST Newsgroups: comp.lang.ada From: Ted Dennison Sender: usenet@www.newsranger.com 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> Subject: Re: Implementing C/C++ style #include... Message-ID: Date: Mon, 26 Mar 2001 19:18:16 GMT NNTP-Posting-Host: 127.0.0.1 X-Complaints-To: abuse@newsranger.com X-Trace: www.newsranger.com 985634296 127.0.0.1 (Mon, 26 Mar 2001 14:18:16 EST) NNTP-Posting-Date: Mon, 26 Mar 2001 14:18:16 EST Organization: http://www.newsranger.com Path: supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!hammer.uoregon.edu!feed.textport.net!news.bnb-lp.com!newsranger.com!www.newsranger.com!not-for-mail Xref: supernews.google.com comp.lang.ada:6069 Date: 2001-03-26T19:18:16+00:00 List-Id: 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. Actually, this is one case where I'd like to see a minor language extension. It'd be nice if the "Convention" parameter took a proper Ada data type of some sort, so that it could be defined as a constant and placed in a convienent place (like a system-dependant constants file). --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html home email - mailto:dennison@telepath.com