It is unrelated to #3005. The suggested solution will not work since the stat function does not exist on mingw (which has essentially the same libraries as the windows compiler). The stat and _stat identifiers cannot not be remapped before including `sys/stat.h` because it has some odd compatibility logic (changing it afterwards, as was done before before, is functional)