fix MSVC build

1) msvc 2010 and later have `stdint.h` -> moved all int definitions to `ostypes.h` and `_MSC_VER < 1600`
2) `strtok_r` unavailable under Windows (both MinGW and MSVC), using `strtok_s` instead
3) `static inline` replaced with `static __inline`