diff --git a/include/wx/filefn.h b/include/wx/filefn.h index c90b482522..0be6462ddb 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -107,6 +107,7 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString; #define O_CREAT _O_CREAT #define O_BINARY _O_BINARY + #define S_IFMT _S_IFMT #define S_IFDIR _S_IFDIR #define S_IFREG _S_IFREG #endif // O_RDONLY diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 6363e17663..679fc5cb89 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1169,7 +1169,7 @@ bool wxPathExists(const wxChar *pszPathName) wxStructStat st; return wxStat(wxFNSTRINGCAST strPath.fn_str(), &st) == 0 && - S_ISDIR(st.st_mode); + ((st.st_mode & S_IFMT) == S_IFDIR); } // Get a temporary filename, opening and closing the file.