Require proper function prototype
Do not include unistd.h on Windows
Use sprintf_s on Windows (but not in MinGW)