From 30d76198c735ff900d04ae03e207bfe86b644f5c Mon Sep 17 00:00:00 2001 From: Ivan Shynkarenka Date: Sat, 6 Aug 2022 17:56:22 -0400 Subject: [PATCH] Compilation issue msys2 #7399 (#7409) * Compilation issue msys2 #7399 * Compilation issue msys2 #7399 --- src/util.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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