I'm sorry, but I'm -1 on including this code; any identifier with `__` is reserved for the implementation and casting a `double*` to `int*` is instant undefined behavior, even apart from the width issue. I just fixed an issue with a similar identifier that caused compilation on Cygwin and Solaris to fail.

If we want to `lgamma` on Windows, then I suggest we either compile the relevant file with `cython --cplus`, because then [`lgamma` is available](http://msdn.microsoft.com/en-us/library/hh308219.aspx) (after fixing some imports, I guess), or we use [John Cook's version](http://www.johndcook.com/cpp_gamma.html), which is in the [public domain](http://www.johndcook.com/stand_alone_code.html) and much more readable than this.