comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: How to import C pointers to structures?
Date: Thu, 22 May 2014 08:37:15 -0500
Date: 2014-05-22T08:37:15-05:00	[thread overview]
Message-ID: <854n0iexys.fsf@stephe-leake.org> (raw)
In-Reply-To: 537ba7ef$0$8750$862e30e2@ngroups.net

Per Sandberg <per.s.sandberg@bahnhof.se> writes:

> $echo "#include <your_interface.h>" >gen.cpp
> $g++ -c -fdump-ada-spec gen.cpp
> then you will get correct mapping:
> your_interface.h <=> your_interface_h.ads
>
> See:
>
> https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gnat_ugn_unw/Running-the-binding-generator.html#Running-the-binding-generator
> for more information.
>
> To "generate" interfaces in any other way is inherently error-prone
> since humans tend to miss a lot of details.

And it can be included in makefiles, so when the .h changes due to an
update, the .ads changes as well.


-- 
-- Stephe

      reply	other threads:[~2014-05-22 13:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-19 22:26 How to import C pointers to structures? Victor Porton
2014-05-19 22:33 ` Shark8
2014-05-19 22:44   ` Adam Beneschan
2014-05-20  0:10     ` Shark8
2014-05-20  0:22       ` Adam Beneschan
2014-05-20  6:36         ` Simon Wright
2014-05-20  8:29 ` björn lundin
2014-05-20 19:07 ` Per Sandberg
2014-05-22 13:37   ` Stephen Leake [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox