fix compile on mingw (x-compile tested only)