Author: ericwf Date: Thu Apr 28 20:22:16 2016 New Revision: 267968 URL: http://llvm.org/viewvc/llvm-project?rev=267968&view=rev Log: Fix possible test breakage for MinGW
Modified: libcxx/trunk/test/support/platform_support.h Modified: libcxx/trunk/test/support/platform_support.h URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/platform_support.h?rev=267968&r1=267967&r2=267968&view=diff ============================================================================== --- libcxx/trunk/test/support/platform_support.h (original) +++ libcxx/trunk/test/support/platform_support.h Thu Apr 28 20:22:16 2016 @@ -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; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits