Fix compiling issues in windows due to different size between int, long, ptrdiff_t