Add a version of unique_file that return just the file name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184206 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Support/PathV2.cpp b/lib/Support/PathV2.cpp
index 0536620..0e02953 100644
--- a/lib/Support/PathV2.cpp
+++ b/lib/Support/PathV2.cpp
@@ -18,8 +18,11 @@
#include <cctype>
#include <cstdio>
#include <cstring>
-#ifdef __APPLE__
+
+#if !defined(_MSC_VER) && !defined(__MINGW32__)
#include <unistd.h>
+#else
+#include <io.h>
#endif
namespace {
@@ -622,6 +625,14 @@
namespace fs {
+error_code unique_file(const Twine &Model, SmallVectorImpl<char> &ResultPath,
+ bool MakeAbsolute, unsigned Mode) {
+ int FD;
+ error_code Ret = unique_file(Model, FD, ResultPath, MakeAbsolute, Mode);
+ close(FD);
+ return Ret;
+}
+
error_code make_absolute(SmallVectorImpl<char> &path) {
StringRef p(path.data(), path.size());