From d290e04d458043bcd0bfc6e1aede38b2524c1c0c Mon Sep 17 00:00:00 2001 From: Rokas Kupstys Date: Tue, 17 Jul 2018 19:46:31 +0300 Subject: [PATCH] Fix build when targeting earlier windows versions by defining _WIN32_WINNT. --- common/TracySystem.cpp | 4 ++-- common/TracySystem.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/TracySystem.cpp b/common/TracySystem.cpp index bfe06266..73f192e2 100644 --- a/common/TracySystem.cpp +++ b/common/TracySystem.cpp @@ -37,7 +37,7 @@ void SetThreadName( std::thread& thread, const char* name ) void SetThreadName( std::thread::native_handle_type handle, const char* name ) { #ifdef _WIN32 -# ifdef NTDDI_WIN10_RS2 +# if defined NTDDI_VERSION && NTDDI_VERSION >= NTDDI_WIN10_RS2 wchar_t buf[256]; mbstowcs( buf, name, 256 ); SetThreadDescription( static_cast( handle ), buf ); @@ -121,7 +121,7 @@ const char* GetThreadName( uint64_t id ) } #else # ifdef _WIN32 -# ifdef NTDDI_WIN10_RS2 +# if defined NTDDI_VERSION && NTDDI_VERSION >= NTDDI_WIN10_RS2 auto hnd = OpenThread( THREAD_QUERY_LIMITED_INFORMATION, FALSE, (DWORD)id ); if( hnd != 0 ) { diff --git a/common/TracySystem.hpp b/common/TracySystem.hpp index 489f5a35..3883c08f 100644 --- a/common/TracySystem.hpp +++ b/common/TracySystem.hpp @@ -2,7 +2,7 @@ #define __TRACYSYSTEM_HPP__ #ifdef TRACY_ENABLE -# if defined __ANDROID__ || defined __CYGWIN__ || defined __APPLE__ || defined _GNU_SOURCE || ( defined _WIN32 && !defined NTDDI_WIN10_RS2 ) +# if defined __ANDROID__ || defined __CYGWIN__ || defined __APPLE__ || defined _GNU_SOURCE || ( defined _WIN32 && ( !defined NTDDI_VERSION || NTDDI_VERSION < NTDDI_WIN10_RS2 ) ) # define TRACY_COLLECT_THREAD_NAMES # endif #endif