Incorrect pre-processor conditions used in gdir.c
Submitted by Kean Johnston
Link to original bug (#660095)
Description
Created attachment 197440 Fix pre-processor conditions in gdir.c
gdir.c uses one particular set of pre-processor conditions to include wdirect.c and related header file, and a completely different condition when using it. This is not useful and break the build.
When including wdirect.c it uses: #if defined (_MSC_VER) && !defined (HAVE_DIRENT_H) which is ok - if you are using the Microsoft compiler and you don't have dirent.h ... but then everywhere in the code where it then uses the wdirect stuff it uses #ifdef G_OS_WIN32 which is incorrect. What if you are using MSVC but you DO have dirent.h?
The attached patch fixes this so the same condition that it used to include the code is used when using it, which is how it should be.
Patch 197440, "Fix pre-processor conditions in gdir.c":
gdir.c.patch