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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,de68e4ddf10693 X-Google-Attributes: gid103376,public From: tmoran@bix.com (Tom Moran) Subject: Re: Multiple pragma Imports Date: 1998/12/27 Message-ID: <3686918c.1630214@news.pacbell.net>#1/1 X-Deja-AN: 426230507 References: <762u9n$kfn$1@nnrp1.dejanews.com> <1998Dec27.083157.1@eisner> X-Complaints-To: abuse@pacbell.net X-Trace: typhoon-sf.snfc21.pbi.net 914788761 206.170.2.56 (Sun, 27 Dec 1998 11:59:21 PDT) Organization: SBC Internet Services NNTP-Posting-Date: Sun, 27 Dec 1998 11:59:21 PDT Newsgroups: comp.lang.ada Date: 1998-12-27T00:00:00+00:00 List-Id: A fairly common situation is that an Ada binding has separated two distinct types, which are the same in C for some function. Thus the Ada binding might have types Server_Socket and Client_Socket, which are opened and used with different parameters, but are closed by a C function with a single parameter. Then a naive thin binding might try to have procedure Close(Client : in out Client_Socket); pragma import(C, Close, "SClose"); procedure Close(Server : in out Server_Socket); pragma import(C, Close, "SClose"); As I understand Robert Dewar's message, this is in fact illegal Ada, though it has been accepted by more than one compiler in the past. Something like procedure Close(Client : in out Client_Socket); pragma import(C, Close, "SClose"); procedure Close(Server : in out Server_Socket) is begin Close(Client_Socket(Server)); -- appropriate type conversion end Close; would be needed.