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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c6e016ae58737f34 X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: win32ada design question/problem Date: 1998/11/19 Message-ID: <36547645.736EF28F@elca-matrix.ch>#1/1 X-Deja-AN: 413606950 Content-Transfer-Encoding: 7bit References: <364C5EDE.4F402D13@elca-matrix.ch> <364c90eb.10939677@SantaClara01.news.InterNex.Net> <36501A46.82C348D3@elca-matrix.ch> <36531538.483857@SantaClara01.news.InterNex.Net> <365454A8.EFCA84F9@elca-matrix.ch> <365455D5.9A1D0B23@Botton.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: ELCA Matrix SA Mime-Version: 1.0 Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1998-11-19T00:00:00+00:00 List-Id: David Botton wrote: > Why wouldn't you use: > > function C_Function ( X : C.char_array ) returns C.Int; > -- int c_function ( char* x); > > pragma Import (C, C_Function); > > From my understanding it will be passed by_referrence, ie. as a char * > [...] That is, of course, a good idea (using Ada 95's C interface stuff), which its guaranteed to be portable. But that is not the approach taken for the win32ada binding, which tried its own, IMO bad, way. The problem with Interfaces.C.Char is that it is not the same as Standard.Character, and Char_Array is not String, so you will have to convert all the time, despite the fact that Char = Character on 99.99% of all platforms. A pity IMO.