Get rid of all warnings and errors on Windows.

This increases msvc compatibility.
I would suggest changing the argument and return type to int64_t instead.