Skip to content

Commit

Permalink
Fix compilation issues with clang without msvc linker
Browse files Browse the repository at this point in the history
Fix i686 compilations

Use SIZE_MAX <= UINT_LEAST32_MAX to ensure it is 32 bit target
instead of 64 bit

fix link2 for msvc since it needs link2

use link2 for WINRT_GetActivationFactory

it is WINRT_IMPL_LINK2 for gcc and clang

avoid dllimport for arm64ec since i do not know how the symbol works

import runtimeobject.lib by default
  • Loading branch information
cqwrteur committed Nov 25, 2024
1 parent fa079fb commit 14b6bd0
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 82 deletions.
8 changes: 8 additions & 0 deletions strings/base_coroutine_foundation.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,9 @@ namespace winrt::impl
if (m_status.load(std::memory_order_relaxed) == AsyncStatus::Started)
{
m_status.store(AsyncStatus::Canceled, std::memory_order_relaxed);
#ifndef _LIBCPP_ABI_MICROSOFT
m_exception = std::make_exception_ptr(hresult_canceled());
#endif
cancel = std::move(m_cancel);
}
}
Expand Down Expand Up @@ -605,6 +607,9 @@ namespace winrt::impl

void unhandled_exception() noexcept
{
#ifdef _LIBCPP_ABI_MICROSOFT
::std::abort();
#else
slim_lock_guard const guard(m_lock);
WINRT_ASSERT(m_status.load(std::memory_order_relaxed) == AsyncStatus::Started || m_status.load(std::memory_order_relaxed) == AsyncStatus::Canceled);
m_exception = std::current_exception();
Expand All @@ -621,6 +626,7 @@ namespace winrt::impl
{
m_status.store(AsyncStatus::Error, std::memory_order_relaxed);
}
#endif
}

template <typename Expression>
Expand Down Expand Up @@ -678,7 +684,9 @@ namespace winrt::impl
}
}

#ifndef _LIBCPP_ABI_MICROSOFT
std::exception_ptr m_exception{};
#endif
slim_mutex m_lock;
async_completed_handler_t<AsyncInterface> m_completed;
winrt::delegate<> m_cancel;
Expand Down
Loading

0 comments on commit 14b6bd0

Please sign in to comment.