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 X-Received: by 2002:ac8:6a05:: with SMTP id t5mr39290763qtr.233.1568267443062; Wed, 11 Sep 2019 22:50:43 -0700 (PDT) X-Received: by 2002:aca:4c54:: with SMTP id z81mr6903110oia.0.1568267442720; Wed, 11 Sep 2019 22:50:42 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!o24no10047773qtl.0!news-out.google.com!x7ni66qtf.0!nntp.google.com!o24no10047766qtl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 11 Sep 2019 22:50:42 -0700 (PDT) In-Reply-To: <8685ca60-7873-44d9-b088-deada2aa074e@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=5.59.149.45; posting-account=DLk27QoAAACr4-LPDwhMe-NhnEWJCvvH NNTP-Posting-Host: 5.59.149.45 References: <8685ca60-7873-44d9-b088-deada2aa074e@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4d103621-ed4f-43b1-8d83-d11c822ce9eb@googlegroups.com> Subject: Re: Complete Simple Examples of "Pragma Import (CPP,...) With Qualifiers? From: godunko@adacore.com Injection-Date: Thu, 12 Sep 2019 05:50:43 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:57135 Date: 2019-09-11T22:50:42-07:00 List-Id: On Wednesday, September 11, 2019 at 9:16:04 PM UTC+3, Ruby_T...@gmail.com w= rote: >=20 > Are there other versions of this that I could see? What about C++ qualifi= ers, members in classes, and namespaces how are they referenced in the pra= gma? >=20 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 re= cord, but you need to control memory layout carefully. So, direct binding t= o C++ is not so simple and it is very complicated to support it. I personal= ly 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++ st= uff mapping and update binding each time API/ABI changed or porting to anot= her C++ compiler.