change to work on windows && replace long with ptrdiff_t
13 files changed