From e2c0efecb3146ad87d8b8532af5c28e462bec113 Mon Sep 17 00:00:00 2001 From: John Parent Date: Fri, 22 May 2026 12:05:34 -0400 Subject: [PATCH] Ld.cxx: use deletefilea not deletefile2a Use api calls compatible with windows 10 and 11 Last windows 10 compat change before Spack drops Windows 10 support Signed-off-by: John Parent --- src/ld.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ld.cxx b/src/ld.cxx index 0876557..2f91217 100644 --- a/src/ld.cxx +++ b/src/ld.cxx @@ -3,7 +3,10 @@ * * SPDX-License-Identifier: (Apache-2.0 OR MIT) */ + + #include "ld.h" +#include #include #include #include @@ -247,7 +250,7 @@ std::unique_ptr 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(::GetLastError()), std::system_category(), "Failed to remove intermediate rc file"); } @@ -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(::GetLastError()), std::system_category(), "Failed to remove intermediate rc file").what() << "\n"; }