Changes for making build works on MinGW