Skip to content

Commit 00cdba2

Browse files
committed
Rename to try_as_with_reason and remove now unused combase linkage
1 parent 1b4ea75 commit 00cdba2

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

cppwinrt/code_writers.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ namespace cppwinrt
11371137
{%
11381138
if constexpr (!std::is_same_v<D, %>)
11391139
{
1140-
auto const [castedResult, code] = static_cast<D const*>(this)->template try_as_reason<%>();
1140+
auto const [castedResult, code] = static_cast<D const*>(this)->template try_as_with_reason<%>();
11411141
check_cast_result(code);
11421142
auto const abiType = *(abi_t<%>**)&castedResult;
11431143
abiType->%(%);
@@ -1156,7 +1156,7 @@ namespace cppwinrt
11561156
{%
11571157
if constexpr (!std::is_same_v<D, %>)
11581158
{
1159-
auto const [castedResult, code] = static_cast<D const*>(this)->template try_as_reason<%>();
1159+
auto const [castedResult, code] = static_cast<D const*>(this)->template try_as_with_reason<%>();
11601160
check_cast_result(code);
11611161
auto const abiType = *(abi_t<%>**)&castedResult;
11621162
WINRT_VERIFY_(0, abiType->%(%));
@@ -1176,7 +1176,7 @@ namespace cppwinrt
11761176
{%
11771177
if constexpr (!std::is_same_v<D, %>)
11781178
{
1179-
auto const [castedResult, code] = static_cast<D const*>(this)->template try_as_reason<%>();
1179+
auto const [castedResult, code] = static_cast<D const*>(this)->template try_as_with_reason<%>();
11801180
check_cast_result(code);
11811181
auto const abiType = *(abi_t<%>**)&castedResult;
11821182
check_hresult(abiType->%(%));

strings/base_extern.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ extern "C"
3232
int32_t __stdcall WINRT_IMPL_RoCaptureErrorContext(int32_t error) noexcept WINRT_IMPL_LINK(RoCaptureErrorContext, 4);
3333
void __stdcall WINRT_IMPL_RoFailFastWithErrorContext(int32_t) noexcept WINRT_IMPL_LINK(RoFailFastWithErrorContext, 4);
3434
int32_t __stdcall WINRT_IMPL_RoTransformError(int32_t, int32_t, void*) noexcept WINRT_IMPL_LINK(RoTransformError, 12);
35-
int32_t __stdcall WINRT_IMPL_GetRestrictedErrorInfo(void**) noexcept WINRT_IMPL_LINK(GetRestrictedErrorInfo, 4);
36-
int32_t __stdcall WINRT_IMPL_SetRestrictedErrorInfo(void*) noexcept WINRT_IMPL_LINK(SetRestrictedErrorInfo, 4);
3735

3836
void* __stdcall WINRT_IMPL_LoadLibraryExW(wchar_t const* name, void* unused, uint32_t flags) noexcept WINRT_IMPL_LINK(LoadLibraryExW, 12);
3937
int32_t __stdcall WINRT_IMPL_FreeLibrary(void* library) noexcept WINRT_IMPL_LINK(FreeLibrary, 4);

strings/base_implements.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,9 +789,9 @@ namespace winrt::impl
789789
}
790790

791791
template <typename Qi>
792-
auto try_as_reason() const noexcept
792+
auto try_as_with_reason() const noexcept
793793
{
794-
return m_inner.try_as_reason<Qi>();
794+
return m_inner.try_as_with_reason<Qi>();
795795
}
796796

797797
explicit operator bool() const noexcept

strings/base_windows.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ namespace winrt::impl
133133
}
134134

135135
template <typename To, typename From, std::enable_if_t<is_com_interface_v<To>, int> = 0>
136-
std::pair<com_ref<To>, hresult> try_as_reason(From* ptr) noexcept
136+
std::pair<com_ref<To>, hresult> try_as_with_reason(From* ptr) noexcept
137137
{
138138
#ifdef WINRT_DIAGNOSTICS
139139
get_diagnostics_info().add_query<To>();
@@ -223,9 +223,9 @@ WINRT_EXPORT namespace winrt::Windows::Foundation
223223
}
224224

225225
template <typename To>
226-
auto try_as_reason() const noexcept
226+
auto try_as_with_reason() const noexcept
227227
{
228-
return impl::try_as_reason<To>(m_ptr);
228+
return impl::try_as_with_reason<To>(m_ptr);
229229
}
230230

231231
template <typename To>

0 commit comments

Comments
 (0)