From 9d11b220eb4f19d823179bfe68ef89c81b1e1079 Mon Sep 17 00:00:00 2001 From: Oleg Ivanov Date: Sat, 6 Apr 2024 12:48:28 +0200 Subject: [PATCH] Fix utDefaultIOStream test under MinGW (#5525) --- test/unit/UnitTestFileGenerator.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/unit/UnitTestFileGenerator.h b/test/unit/UnitTestFileGenerator.h index 2166c6939..93007bad9 100644 --- a/test/unit/UnitTestFileGenerator.h +++ b/test/unit/UnitTestFileGenerator.h @@ -44,9 +44,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#if defined(_MSC_VER) || defined(__MINGW64__) || defined(__MINGW32__) +#define TMP_PATH "./" +#elif defined(__GNUC__) || defined(__clang__) +#define TMP_PATH "/tmp/" +#endif + #if defined(_MSC_VER) #include -#define TMP_PATH "./" inline FILE* MakeTmpFile(char* tmplate) { auto pathtemplate = _mktemp(tmplate); @@ -60,7 +65,6 @@ inline FILE* MakeTmpFile(char* tmplate) return fs; } #elif defined(__GNUC__) || defined(__clang__) -#define TMP_PATH "/tmp/" inline FILE* MakeTmpFile(char* tmplate) { auto fd = mkstemp(tmplate);