mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Remove windows_error.
MSVC doesn't seem to provide any is_error_code_enum enumeration for the windows errors. Fortunately very few places in llvm have to handle raw windows errors, so we can just construct the corresponding error_code directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210631 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -169,6 +169,10 @@ namespace {
|
||||
typedef ScopedHandle<FileHandle> FileScopedHandle;
|
||||
}
|
||||
|
||||
static error_code windows_error(unsigned E) {
|
||||
return error_code(E, system_category());
|
||||
}
|
||||
|
||||
static error_code GetFileNameFromHandle(HANDLE FileHandle,
|
||||
std::string& Name) {
|
||||
char Filename[MAX_PATH+1];
|
||||
@@ -245,7 +249,7 @@ static std::string FindProgram(const std::string &Program, error_code &ec) {
|
||||
ec = windows_error(::GetLastError());
|
||||
else if (length > array_lengthof(PathName)) {
|
||||
// This may have been the file, return with error.
|
||||
ec = windows_error::buffer_overflow;
|
||||
ec = windows_error(ERROR_BUFFER_OVERFLOW);
|
||||
break;
|
||||
} else {
|
||||
// We found the path! Return it.
|
||||
|
Reference in New Issue
Block a user