Fix possible test breakage for MinGW

llvm-svn: 267968
This commit is contained in:
Eric Fiselier 2016-04-29 01:22:16 +00:00
parent 01c7450ec5
commit 23323e25f8
1 changed files with 9 additions and 8 deletions

View File

@ -67,16 +67,17 @@ extern "C" {
#ifndef __CloudABI__ #ifndef __CloudABI__
inline inline
std::string std::string get_temp_file_name()
get_temp_file_name()
{ {
#if defined(_WIN32) || defined(__MINGW32__) #if defined(__MINGW32__)
char Path[MAX_PATH + 1];
char FN[MAX_PATH + 1];
do { } while (0 == GetTempPath(MAX_PATH+1, Path));
do { } while (0 == GetTempFileName(Path, "libcxx", 0, FN));
return FN;
#elif defined(_WIN32)
char Name[] = "libcxx.XXXXXX"; char Name[] = "libcxx.XXXXXX";
if (_mktemp_s(Name, sizeof(Name)) != 0) abort();
if (_mktemp_s(Name, sizeof(Name)) != 0) {
abort();
}
return Name; return Name;
#else #else
std::string Name; std::string Name;