bjz/glfw-rs — pull request #67 by rlane (2014-01-02 01:32:13+00:00)
Title: remove Option types from FFI declarations

On i386, rustc expects Option instances to be returned on the stack. The caller
passes a pointer to allocated stack space and the callee fills it in. This is
not the calling convention expected by C functions like glfwSetErrorCallback
that return a pointer in EAX.

Somehow this led to a segfault on i386 because the stack pointer was incorrect
when returning from the caller. This didn't happen on x86-64.

I couldn't find any documentation on using Option types with the FFI. If this is supposed
to work then I'll file an issue against rustc instead.