importC to bindings via -Hf=your.di intermediate ?

Bruce Carneal bcarneal at gmail.com
Wed Sep 6 00:55:57 UTC 2023


On Wednesday, 6 September 2023 at 00:53:40 UTC, Bruce Carneal 
wrote:
> I'm trying to use importC to help automate .di and targeted 
> library production (for the Nvidia libs that dcompute taps 
> into).
>
> As you'll note if you try this yourself, the -Hf output of an 
> importC run looks pretty interesting but has some, obvious, 
> systemic problems.  For example:
>
>   typedef SomeOpaqueStructYoureNotSupposedToSeeInside *HandleT;
> becomes
>   alias HandleT = struct 
> SomeOpaqueStructYoureNotSupposedToSeeInside*;
>
> I wondered if others have experience generating bindings with 
> importC and suggestions they'd care to share.
>
> I will note that I've had some luck using importC directly, 
> with a little fiddling, but it looks like it could also be a 
> supported/robust 99%+ binding generator going forward with some 
> work.

Sorry, typo, left out "struct" in the C typedef:
   typedef struct SomeOpaqueStructYoureNotSupposedToSeeInside 
*HandleT;


More information about the Digitalmars-d mailing list