Load dynamic libraries with no hand-written bindings!

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Sep 7 09:57:59 UTC 2022


On Tuesday, 6 September 2022 at 16:03:03 UTC, Andrej Mitrovic 
wrote:
> There is a really cool benefit to having the ImportC feature in 
> the language. It enables us to dynamically bind to C libraries 
> without having to write any bindings code by hand!

There are some quirks though. For example the code will try to 
load this as if it were a function:

```c
typedef int PaStreamCallback(
     const void *input, void *output,
     unsigned long frameCount,
     const PaStreamCallbackTimeInfo* timeInfo,
     PaStreamCallbackFlags statusFlags,
     void *userData );
```

But it's actually just a typedef for a callback.


More information about the Digitalmars-d mailing list