On Friday, 19 July 2013 at 15:36:33 UTC, Ali Çehreli wrote:

Error: static assert "Aliases to mutable thread-local data not allowed."
       instantiated from here: send!(void*)

Is that the problem? (If so, why don't you say so? ;))

Then there are two solutions:

a) Make _wnd a shared(GLFWwindow):

struct Window {
    // ...

    shared(GLFWwindow)* _wnd;
}

The code now compiles.

b) As Sean Kelly said, cast to shared before sending:

        send(tid, cast(shared(GLFWwindow)*)_wnd );

With the b option you may need to change the definition of the receiving delegate to shared as well:

            (const(shared(GLFWwindow)*) window) { }

But that change is not needed in that simple code.

unfortunately both variants fails for me, i think this is because GLFWwindow is (pre)defined as struct instead alias void :(

maybe there is something to override type definition without modifying 3rd party libraries code?

/Users/evilrat/Documents/prog/Derelict3/import/derelict/glfw3/types.d(290): Error: struct derelict.glfw3.types.GLFWwindow unknown size /Users/evilrat/Documents/prog/Derelict3/import/derelict/glfw3/types.d(290): Error: struct derelict.glfw3.types.GLFWwindow no size yet for forward reference

anyway thanks to both authors, now i could avoid such problems in the future \0/

P.S. Additionally, the const on the receiving side probably should apply only to what is being pointed at (as opposed to the pointer itself):

            (const(GLFWwindow)* window) { }

ah yes, such a shame. i'm sometimes forgot about this little detail :(

Reply via email to