diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-04-29 01:22:16 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-04-29 01:22:16 +0000 |
commit | 23323e25f896cf44e6d4519ef38f066e45fe408f (patch) | |
tree | 461503a6244e8ca1d006143e585e8db78d82f673 /libcxx | |
parent | 01c7450ec56b79c07988b17e39fa0d68b7e79d2e (diff) | |
download | bcm5719-llvm-23323e25f896cf44e6d4519ef38f066e45fe408f.tar.gz bcm5719-llvm-23323e25f896cf44e6d4519ef38f066e45fe408f.zip |
Fix possible test breakage for MinGW
llvm-svn: 267968
Diffstat (limited to 'libcxx')
-rw-r--r-- | libcxx/test/support/platform_support.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libcxx/test/support/platform_support.h b/libcxx/test/support/platform_support.h index f5981d1d087..f4c2247e0df 100644 --- a/libcxx/test/support/platform_support.h +++ b/libcxx/test/support/platform_support.h @@ -67,16 +67,17 @@ extern "C" { #ifndef __CloudABI__ inline -std::string -get_temp_file_name() +std::string 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"; - - if (_mktemp_s(Name, sizeof(Name)) != 0) { - abort(); - } - + if (_mktemp_s(Name, sizeof(Name)) != 0) abort(); return Name; #else std::string Name; |