diff --git a/CMakeLists.txt b/CMakeLists.txt index d0eed988..a180afb4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,6 +98,8 @@ set_target_properties(concurrencpp PROPERTIES SOVERSION "${PROJECT_VERSION_MAJOR}" ) +set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX "d") + target_coroutine_options(concurrencpp) target_compile_definitions(concurrencpp diff --git a/include/concurrencpp/results/impl/shared_result_state.h b/include/concurrencpp/results/impl/shared_result_state.h index 6c96f4b2..1433e74e 100644 --- a/include/concurrencpp/results/impl/shared_result_state.h +++ b/include/concurrencpp/results/impl/shared_result_state.h @@ -5,6 +5,7 @@ #include "concurrencpp/results/impl/result_state.h" #include +#include #include #include diff --git a/include/concurrencpp/results/result.h b/include/concurrencpp/results/result.h index 72cc25fd..763adc77 100644 --- a/include/concurrencpp/results/result.h +++ b/include/concurrencpp/results/result.h @@ -11,7 +11,7 @@ namespace concurrencpp { template - class result { + class [[nodiscard]] result { static constexpr auto valid_result_type_v = std::is_same_v || std::is_nothrow_move_constructible_v; diff --git a/include/concurrencpp/threads/thread.h b/include/concurrencpp/threads/thread.h index 82ca58b5..ecdaa270 100644 --- a/include/concurrencpp/threads/thread.h +++ b/include/concurrencpp/threads/thread.h @@ -4,6 +4,7 @@ #include "concurrencpp/platform_defs.h" #include +#include #include #include diff --git a/source/threads/thread.cpp b/source/threads/thread.cpp index e00a28a4..ae7166a2 100644 --- a/source/threads/thread.cpp +++ b/source/threads/thread.cpp @@ -47,11 +47,17 @@ size_t thread::hardware_concurrency() noexcept { #ifdef CRCPP_WIN_OS # include +# include void thread::set_name(std::string_view name) noexcept { - const std::wstring utf16_name(name.begin(), - name.end()); // concurrencpp strings are always ASCII (english only) - ::SetThreadDescription(::GetCurrentThread(), utf16_name.data()); + if (IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN10), LOBYTE(_WIN32_WINNT_WIN10), 14393)) { + // Windows 10 1607 or greater, use SetThreadDescription + const std::wstring utf16_name(name.begin(), + name.end()); // concurrencpp strings are always ASCII (english only) + ::SetThreadDescription(::GetCurrentThread(), utf16_name.c_str()); + } else { + // Windows version is less than Windows 10, do nothing + } } #elif defined(CRCPP_MINGW_OS)