https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61889
--- Comment #19 from Kai Tietz <ktietz at gcc dot gnu.org> --- Hi Xur, I asked you in my intial support to check for existance of FTW-API, and not to implement it for Win32. So first, send patch checking in a valid way if API can be used. The ftw/nftw emulation you wrote seems to me more suitable for libiberty. And again in most places the check for _WIN32 isn't right. You should check instead for mingw-target, means for __MINGW32__ instead, as for cygwin this macro might be defined in some circumstances. And make sure that you disable code-paths only for mingw-targets iff we don't have the FTW-API. I would suggest to make out this patch 2 separate patches.