Skip to content
Permalink
Browse files
Merge pull request #8898 from JosJuice/windows-cmake-new-lambda-proce…
…ssor

Replace Windows CMake lambda constexpr capture workaround
  • Loading branch information
Tilka committed Jun 25, 2020
2 parents 502ab78 + c9edfa0 commit 4eb4b1d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
@@ -241,6 +241,8 @@ if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
add_compile_options(/Zc:throwingNew)
# Enforce strict volatile semantics as per ISO C++
add_compile_options(/volatile:iso)
# Fix non-conformant lambda behavior (constexpr variables shouldn't need capturing)
add_compile_options(/experimental:newLambdaProcessor)

string(APPEND CMAKE_EXE_LINKER_FLAGS " /NXCOMPAT")
else()
@@ -139,26 +139,26 @@ void VerifyWidget::Verify()
progress.GetRaw()->setMinimumDuration(500);
progress.GetRaw()->setWindowModality(Qt::WindowModal);

auto future = std::async(
std::launch::async,
[&verifier, &progress, DIVISOR]() -> std::optional<DiscIO::VolumeVerifier::Result> {
progress.SetValue(0);
verifier.Start();
while (verifier.GetBytesProcessed() != verifier.GetTotalBytes())
{
progress.SetValue(static_cast<int>(verifier.GetBytesProcessed() / DIVISOR));
if (progress.WasCanceled())
return std::nullopt;

verifier.Process();
}
verifier.Finish();

const DiscIO::VolumeVerifier::Result result = verifier.GetResult();
progress.Reset();

return result;
});
auto future =
std::async(std::launch::async,
[&verifier, &progress]() -> std::optional<DiscIO::VolumeVerifier::Result> {
progress.SetValue(0);
verifier.Start();
while (verifier.GetBytesProcessed() != verifier.GetTotalBytes())
{
progress.SetValue(static_cast<int>(verifier.GetBytesProcessed() / DIVISOR));
if (progress.WasCanceled())
return std::nullopt;

verifier.Process();
}
verifier.Finish();

const DiscIO::VolumeVerifier::Result result = verifier.GetResult();
progress.Reset();

return result;
});
progress.GetRaw()->exec();

std::optional<DiscIO::VolumeVerifier::Result> result = future.get();
@@ -196,7 +196,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
}

mmio->Register(base | FIFO_BP_LO, MMIO::DirectRead<u16>(MMIO::Utils::LowPart(&fifo.CPBreakpoint)),
MMIO::ComplexWrite<u16>([WMASK_LO_ALIGN_32BIT](u32, u16 val) {
MMIO::ComplexWrite<u16>([](u32, u16 val) {
WriteLow(fifo.CPBreakpoint, val & WMASK_LO_ALIGN_32BIT);
}));
mmio->Register(base | FIFO_BP_HI,

0 comments on commit 4eb4b1d

Please sign in to comment.