Re: Dynamic bindings to global variables

2015-08-02 Thread remi thebault via Digitalmars-d-learn
On Sunday, 2 August 2015 at 16:20:29 UTC, remi thebault wrote: On Sunday, 2 August 2015 at 15:38:34 UTC, Mike Parker wrote: You have to declare it as a pointer, then retrieve the pointer in the same way you do the function pointers, via the system loader (GetProcAddress/dlsym). and how would

Re: Dynamic bindings to global variables

2015-08-02 Thread remi thebault via Digitalmars-d-learn
On Sunday, 2 August 2015 at 15:38:34 UTC, Mike Parker wrote: You have to declare it as a pointer, then retrieve the pointer in the same way you do the function pointers, via the system loader (GetProcAddress/dlsym). and how would you make this source compatible with the static binding version

Re: Dynamic bindings to global variables

2015-08-02 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 2 August 2015 at 15:31:48 UTC, remi thebault wrote: Hello I wrote static bindings to a C library. I want to also offer a version(Dynamic) of the bindings. I follow and use derelict-util to get the address of function pointers. In the library I bind, there is also global variables.

Dynamic bindings to global variables

2015-08-02 Thread remi thebault via Digitalmars-d-learn
Hello I wrote static bindings to a C library. I want to also offer a version(Dynamic) of the bindings. I follow and use derelict-util to get the address of function pointers. In the library I bind, there is also global variables. here's one example in the static bindings: extern __gshared