diff --git a/src/util.cpp b/src/util.cpp index 4620801cc..0b8aa279c 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -24,7 +24,7 @@ # define _XOPEN_SOURCE 700L #endif -#ifdef _WIN32 +#if defined(_WIN32) || defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # endif @@ -35,7 +35,9 @@ # include # endif # include // Must be included before -# include +# ifndef __CYGWIN__ +# include +# endif # include # undef interface // This is also important because of reasons #endif @@ -212,7 +214,7 @@ std::string AbsolutePath(const std::string &filepath) { #ifdef FLATBUFFERS_NO_ABSOLUTE_PATH_RESOLUTION return filepath; #else - #ifdef _WIN32 + #if defined(_WIN32) || defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) char abs_path[MAX_PATH]; return GetFullPathNameA(filepath.c_str(), MAX_PATH, abs_path, nullptr) #else