From: godunko@adacore.com
Subject: Re: Complete Simple Examples of "Pragma Import (CPP,...) With Qualifiers?
Date: Wed, 11 Sep 2019 22:50:42 -0700 (PDT)
Date: 2019-09-11T22:50:42-07:00 [thread overview]
Message-ID: <4d103621-ed4f-43b1-8d83-d11c822ce9eb@googlegroups.com> (raw)
In-Reply-To: <8685ca60-7873-44d9-b088-deada2aa074e@googlegroups.com>
On Wednesday, September 11, 2019 at 9:16:04 PM UTC+3, Ruby_T...@gmail.com wrote:
>
> Are there other versions of this that I could see? What about C++ qualifiers, members in classes, and namespaces how are they referenced in the pragma?
>
You need to use pragma CPP_Constructor to bind constructors. External_Names are always mangled names, used by linker. Class fields may be mapped to record, but you need to control memory layout carefully. So, direct binding to C++ is not so simple and it is very complicated to support it. I personally prefer to create C wrappers around C++ classes when possible, more code need to be produced, but you don't need to take care about low level C++ stuff mapping and update binding each time API/ABI changed or porting to another C++ compiler.
next prev parent reply other threads:[~2019-09-12 5:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-11 18:16 Complete Simple Examples of "Pragma Import (CPP,...) With Qualifiers? Ruby_Tuesday@gmail.com
2019-09-11 22:27 ` Lucretia
2019-09-12 5:50 ` godunko [this message]
2019-09-12 12:00 ` Ruby_Tuesday@gmail.com
2019-09-13 0:00 ` Roger
2019-09-13 0:04 ` Roger
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox