sys_getlasterror cast on mingw