From 73021b89e0e130068947e828e7316bf5f600b34f Mon Sep 17 00:00:00 2001 From: Jethro Grassie Date: Fri, 30 Aug 2019 17:27:06 -0400 Subject: [PATCH] fix MSYS thread handle cast --- src/tests/affinity.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/affinity.cpp b/src/tests/affinity.cpp index db57976..33a95e7 100644 --- a/src/tests/affinity.cpp +++ b/src/tests/affinity.cpp @@ -45,7 +45,7 @@ set_thread_affinity(const unsigned &cpuid) { std::thread::native_handle_type thread; #if defined(_WIN32) || defined(__CYGWIN__) - thread = static_cast(GetCurrentThread()); + thread = reinterpret_cast(GetCurrentThread()); #else thread = static_cast(pthread_self()); #endif @@ -64,7 +64,7 @@ set_thread_affinity(std::thread::native_handle_type thread, rc = thread_policy_set(mach_thread, THREAD_AFFINITY_POLICY, (thread_policy_t)&policy, 1); #elif defined(_WIN32) || defined(__CYGWIN__) - rc = SetThreadAffinityMask(static_cast(thread), 1ULL << cpuid) == 0 ? -2 : 0; + rc = SetThreadAffinityMask(reinterpret_cast(thread), 1ULL << cpuid) == 0 ? -2 : 0; #else cpu_set_t cs; CPU_ZERO(&cs);