mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-03 12:18:00 +00:00
Use static instead of an anonymous namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201983 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -85,14 +85,13 @@ namespace {
|
|||||||
|
|
||||||
operator int() const {return FileDescriptor;}
|
operator int() const {return FileDescriptor;}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
error_code TempDir(SmallVectorImpl<char> &result) {
|
static error_code TempDir(SmallVectorImpl<char> &result) {
|
||||||
// FIXME: Don't use TMPDIR if program is SUID or SGID enabled.
|
// FIXME: Don't use TMPDIR if program is SUID or SGID enabled.
|
||||||
const char *dir = 0;
|
const char *dir = 0;
|
||||||
(dir = std::getenv("TMPDIR" )) ||
|
(dir = std::getenv("TMPDIR")) || (dir = std::getenv("TMP")) ||
|
||||||
(dir = std::getenv("TMP" )) ||
|
(dir = std::getenv("TEMP")) || (dir = std::getenv("TEMPDIR")) ||
|
||||||
(dir = std::getenv("TEMP" )) ||
|
|
||||||
(dir = std::getenv("TEMPDIR")) ||
|
|
||||||
#ifdef P_tmpdir
|
#ifdef P_tmpdir
|
||||||
(dir = P_tmpdir) ||
|
(dir = P_tmpdir) ||
|
||||||
#endif
|
#endif
|
||||||
@@ -102,7 +101,6 @@ namespace {
|
|||||||
StringRef d(dir);
|
StringRef d(dir);
|
||||||
result.append(d.begin(), d.end());
|
result.append(d.begin(), d.end());
|
||||||
return error_code::success();
|
return error_code::success();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static error_code createUniqueEntity(const Twine &Model, int &ResultFD,
|
static error_code createUniqueEntity(const Twine &Model, int &ResultFD,
|
||||||
|
@@ -44,9 +44,8 @@ using namespace llvm;
|
|||||||
using llvm::sys::windows::UTF8ToUTF16;
|
using llvm::sys::windows::UTF8ToUTF16;
|
||||||
using llvm::sys::windows::UTF16ToUTF8;
|
using llvm::sys::windows::UTF16ToUTF8;
|
||||||
|
|
||||||
namespace {
|
static error_code TempDir(SmallVectorImpl<wchar_t> &result) {
|
||||||
error_code TempDir(SmallVectorImpl<wchar_t> &result) {
|
retry_temp_dir:
|
||||||
retry_temp_dir:
|
|
||||||
DWORD len = ::GetTempPathW(result.capacity(), result.begin());
|
DWORD len = ::GetTempPathW(result.capacity(), result.begin());
|
||||||
|
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
@@ -59,9 +58,9 @@ namespace {
|
|||||||
|
|
||||||
result.set_size(len);
|
result.set_size(len);
|
||||||
return error_code::success();
|
return error_code::success();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_separator(const wchar_t value) {
|
static bool is_separator(const wchar_t value) {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case L'\\':
|
case L'\\':
|
||||||
case L'/':
|
case L'/':
|
||||||
@@ -69,7 +68,6 @@ namespace {
|
|||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: mode should be used here and default to user r/w only,
|
// FIXME: mode should be used here and default to user r/w only,
|
||||||
|
Reference in New Issue
Block a user