diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8a44a70..c248e84 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -119,7 +119,7 @@ set_property( if (MSVC) set( UMB_ECHO_SERVER_COMPILE_OPTIONS - /await + /await:strict ) else () set( diff --git a/tests/umb_echo_server.cpp b/tests/umb_echo_server.cpp index 864cabb..558909a 100644 --- a/tests/umb_echo_server.cpp +++ b/tests/umb_echo_server.cpp @@ -22,6 +22,19 @@ * */ +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) + +#define WINDOWS 1 + +// Silence "Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately". +#include + +#else + +#define WINDOWS 0 + +#endif + #include #include #include @@ -79,7 +92,11 @@ awaitable echo(tcp::socket socket) const auto type = static_cast( data[2] | (data[3] << 8)); +#if WINDOWS + const auto mt_str = std::to_string(static_cast(type)); +#else const auto mt_str = testmessages::umb::meta::to_string(type); +#endif std::cout << std::format("type: {}\n", mt_str); const auto payload = std::span{data.data(), size};