Skip to content

Commit

Permalink
Fix handler tracking on WinRT.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskohlhoff committed Mar 13, 2015
1 parent 55194c0 commit 6614ff6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
10 changes: 8 additions & 2 deletions asio/include/asio/detail/impl/handler_tracking.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
# include "asio/wait_traits.hpp"
#endif // defined(ASIO_HAS_BOOST_DATE_TIME)

#if !defined(ASIO_WINDOWS)
#if defined(ASIO_WINDOWS_RUNTIME)
# include "asio/detail/socket_types.hpp"
#elif !defined(ASIO_WINDOWS)
# include <unistd.h>
#endif // !defined(ASIO_WINDOWS)

Expand Down Expand Up @@ -327,7 +329,11 @@ void handler_tracking::write_line(const char* format, ...)

va_end(args);

#if defined(ASIO_WINDOWS)
#if defined(ASIO_WINDOWS_RUNTIME)
wchar_t wline[256] = L"";
mbstowcs_s(0, wline, sizeof(wline) / sizeof(wchar_t), line, length);
::OutputDebugStringW(wline);
#elif defined(ASIO_WINDOWS)
HANDLE stderr_handle = ::GetStdHandle(STD_ERROR_HANDLE);
DWORD bytes_written = 0;
::WriteFile(stderr_handle, line, length, &bytes_written, 0);
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/detail/winrt_resolve_op.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class winrt_resolve_op :
if (owner)
{
fenced_block b(fenced_block::half);
ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, "..."));
w.complete(handler, handler.handler_);
ASIO_HANDLER_INVOCATION_END;
}
Expand Down
3 changes: 2 additions & 1 deletion asio/include/asio/detail/winrt_resolver_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class winrt_resolver_service

// Asynchronously resolve a query to a list of entries.
template <typename Handler>
void async_resolve(implementation_type&,
void async_resolve(implementation_type& impl,
const query_type& query, Handler& handler)
{
bool is_continuation =
Expand All @@ -131,6 +131,7 @@ class winrt_resolver_service

ASIO_HANDLER_CREATION((io_service_.context(),
*p.p, "resolver", &impl, 0, "async_resolve"));
(void)impl;

try
{
Expand Down
2 changes: 1 addition & 1 deletion asio/include/asio/detail/winrt_socket_connect_op.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class winrt_socket_connect_op :
if (owner)
{
fenced_block b(fenced_block::half);
ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_));
w.complete(handler, handler.handler_);
ASIO_HANDLER_INVOCATION_END;
}
Expand Down

0 comments on commit 6614ff6

Please sign in to comment.