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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Header-only Ada libraries... Date: Thu, 31 May 2018 15:34:08 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 31 May 2018 13:34:09 -0000 (UTC) Injection-Info: h2725194.stratoserver.net; posting-host="c5e52339ecf7a7b4993c767c0d1476b7"; logging-data="13969"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ahpVT7qPesqwPeA8uNHC0s17xkIH1P4A=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 Cancel-Lock: sha1:ppWaZSQEKO0smuX9mv51GTv+VQ8= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:52808 Date: 2018-05-31T15:34:08+02:00 List-Id: On 05/31/2018 02:18 PM, joakimds@kth.se wrote: > > A trick that is GNAT specific that I use in the Ada binding to Wayland (https://github.com/joakim-strandberg/wayland_ada_binding) on Linux (and which might work on other platforms too when using GNAT) is using the standard String type where the input argument is char*. In the C code the function wl_display_connect has the following signature: I don't think it's GNAT specific. This is implementation advice in ARM B.3. But I would recommend using the types in Interfaces.C whenever possible when interfacing with C. In this case, that would be Interfaces.C.char_array. When there is no suitable type in Interfaces.C, I recommend only using types that have been declared with convention C. -- Jeff Carter "If a sperm is wasted, God gets quite irate." Monty Python's the Meaning of Life 56