Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/ld.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
*
* SPDX-License-Identifier: (Apache-2.0 OR MIT)
*/


#include "ld.h"
#include <Windows.h>
#include <errhandlingapi.h>
#include <fileapi.h>
#include <minwindef.h>
Expand Down Expand Up @@ -247,7 +250,7 @@ std::unique_ptr<RCFileManager> LdInvocation::createRC(LinkerInvocation& link_run
if (err_code != 0) {
throw RCCompilerFailure("Could not compile RC file");
}
if(!DeleteFile2A(rc_file_name.c_str(), FILE_FLAG_DISALLOW_PATH_REDIRECTS)) {
if(!DeleteFileA(rc_file_name.c_str())) {
throw std::system_error(static_cast<int>(::GetLastError()),
std::system_category(), "Failed to remove intermediate rc file");
}
Expand All @@ -261,7 +264,7 @@ RCFileManager::RCFileManager(std::string file) {
}

RCFileManager::~RCFileManager(){
if(!DeleteFile2A(this->rc_file_.c_str(), FILE_FLAG_DISALLOW_PATH_REDIRECTS)) {
if(!DeleteFileA(this->rc_file_.c_str())) {
std::cerr << std::system_error(static_cast<int>(::GetLastError()),
std::system_category(), "Failed to remove intermediate rc file").what() << "\n";
}
Expand Down
Loading