[libcxx] [test] Fix the get_temp_file_name() function for mingw

Add the missing includes for getting the defines and functions used
in the mingw version of get_temp_file_name().

This fixes 31 tests when built in a mingw configuration.

Also remove a redundant ifdef; _WIN32 is defined in mingw targets too.

Differential Revision: https://reviews.llvm.org/D97456
This commit is contained in:
Martin Storsjö 2021-02-25 12:43:36 +02:00
parent f5f3a59837
commit d07e5c23b4
1 changed files with 3 additions and 1 deletions

View File

@ -56,8 +56,10 @@
#include <codecvt> #include <codecvt>
#include <locale> #include <locale>
#include <string> #include <string>
#if defined(_WIN32) || defined(__MINGW32__) #if defined(_WIN32)
# define WIN32_LEAN_AND_MEAN // Reduce overhead of including windows.h
# include <io.h> // _mktemp_s # include <io.h> // _mktemp_s
# include <windows.h> // MAX_PATH, GetTempPath, GetTempFileName
#else #else
# include <unistd.h> // close # include <unistd.h> // close
#endif #endif