mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +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:
@@ -44,31 +44,29 @@ using namespace llvm;
|
||||
using llvm::sys::windows::UTF8ToUTF16;
|
||||
using llvm::sys::windows::UTF16ToUTF8;
|
||||
|
||||
namespace {
|
||||
error_code TempDir(SmallVectorImpl<wchar_t> &result) {
|
||||
retry_temp_dir:
|
||||
DWORD len = ::GetTempPathW(result.capacity(), result.begin());
|
||||
static error_code TempDir(SmallVectorImpl<wchar_t> &result) {
|
||||
retry_temp_dir:
|
||||
DWORD len = ::GetTempPathW(result.capacity(), result.begin());
|
||||
|
||||
if (len == 0)
|
||||
return windows_error(::GetLastError());
|
||||
if (len == 0)
|
||||
return windows_error(::GetLastError());
|
||||
|
||||
if (len > result.capacity()) {
|
||||
result.reserve(len);
|
||||
goto retry_temp_dir;
|
||||
}
|
||||
|
||||
result.set_size(len);
|
||||
return error_code::success();
|
||||
if (len > result.capacity()) {
|
||||
result.reserve(len);
|
||||
goto retry_temp_dir;
|
||||
}
|
||||
|
||||
bool is_separator(const wchar_t value) {
|
||||
switch (value) {
|
||||
case L'\\':
|
||||
case L'/':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
result.set_size(len);
|
||||
return error_code::success();
|
||||
}
|
||||
|
||||
static bool is_separator(const wchar_t value) {
|
||||
switch (value) {
|
||||
case L'\\':
|
||||
case L'/':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user