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,ac6f6c30c45f808a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Nick Roberts Newsgroups: comp.lang.ada Subject: Re: Ada equivalent for C-pointer? Date: Sat, 15 Jan 2005 16:50:28 +0000 Message-ID: References: <41E7F653.2F899F47@alfred-hilscher.de> Content-Type: text/plain; charset=us-ascii X-Trace: individual.net QSt1V2ZFPqRKA7IsQp2Y6gl79a+9xspCafowRWNF3oTA2U1pQ= X-Orig-Path: not-for-mail User-Agent: Gemini/1.45d (Qt/3.3.2) (Windows-XP) Xref: g2news1.google.com comp.lang.ada:7818 Date: 2005-01-15T16:50:28+00:00 List-Id: Pascal Obry wrote: > I don't think so. Here Number will be passed by value, no? No, I don't think so (with GNAT/GCC). > And you also need the returned value ;) Yes, oops! > So, you probably want: > > function Wibble (Number: access Interfaces.C.int) > return Interfaces.C.int; > > pragma Import(C,Wibble,"wibble"); I think the 'in out' mode would work with GNAT/GCC, but I'd suggest testing it to make sure. I suppose using the 'access' mode might be clearer, and it might be slightly more efficient. -- Nick Roberts