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,fbb2432d0a728c1b X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: help with pointerproblem. Date: 1998/09/11 Message-ID: <35F92121.7C105BD4@elca-matrix.ch>#1/1 X-Deja-AN: 390098802 Content-Transfer-Encoding: 7bit References: <35f7f673.0@newsfeed.uu.se> 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-09-11T00:00:00+00:00 List-Id: Roger Carlsson wrote: > I'm writing a program in ada95 with opengl on W95. > > I have the following definitions in GL.ads: > > type GLubyte is new C.unsigned_char; > type GLpointer is access all GLubyte; -- our substitute for "void *" The substibute for void * in Ada is called System.Address. Just write your C subporgrams in Ada with System.Address as parameters, e.g: function example (X : System.Address) return Interfaces.C.Int; pragma Import (C, example); ... Z : VertexArray(...); Result := example(Z'Address); I have always done it this way and it works great will all compilers I have used. Another approach is using access parameters (you get better type checking this way) but I'll let someone else decribe that (I have never used it myself).