shared libs for OSX

bitwise via Digitalmars-d digitalmars-d at puremagic.com
Wed May 27 14:24:25 PDT 2015


On Wed, 27 May 2015 02:45:57 -0400, Jacob Carlborg <doob at me.com> wrote:
>
> What about using a D dynamic library in a C application? The C  
> application would initialize the runtime which would register the  
> callback. Then it would be undefined to unload druntime?

Good point.

I've come up another solution and posted it here:
http://dpaste.com/0DXBSNQ

Basically, I've gone back to the idea of using the dylib ctor/dtors. I  
don't think we really even need the image-added callback, at least not for  
dylibs.

I callback could still be used when the main application is written in D,  
but we could also replace it with my solution in the dpaste(the  
getThisImageInfo function).

As far as TLS goes, I haven't looking into the details of actually  
initializing the images yet. Once we have a solution for when and how to  
initialize the dylibs, I'll move on to the specifics... pun intended ;)

I think the solution above may be a winner though.

     Bit


More information about the Digitalmars-d mailing list