From e93ddd2aa7a7fc430688c09d551afed835def160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Gr=C3=A9goire?= Date: Fri, 29 May 2026 17:15:30 +0200 Subject: [PATCH 1/2] When using the MSVC C runtime, `fileno` doesn't actually exist, use `_fileno` instead. OLDNAMES.lib may not be linked if you use /NODEFAULTLIB. Note: This uses `_MSC_VER` as a gate and not _WIN32 as MinGW apparently uses `fileno` and not `_fileno`. --- public/client/TracyProfiler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/client/TracyProfiler.cpp b/public/client/TracyProfiler.cpp index 05ed9922..0e19d6e7 100644 --- a/public/client/TracyProfiler.cpp +++ b/public/client/TracyProfiler.cpp @@ -10,7 +10,9 @@ # include # include # include "../common/TracyWinFamily.hpp" -# ifndef _MSC_VER +# if defined(_MSC_VER) // https://devblogs.microsoft.com/oldnewthing/20200730-00/?p=104021/ +# define fileno _fileno +# else # include # endif #else From 0e52e387bd7fa73cf4ff48c8e5d1f1c4ee141a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Gr=C3=A9goire?= Date: Fri, 29 May 2026 17:16:39 +0200 Subject: [PATCH 2/2] gate `GetUserNameExA` behind `TRACY_WIN32_NO_DESKTOP` Same as `GetUserNameA` in `GetUserLogin` --- public/common/TracySystem.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/common/TracySystem.cpp b/public/common/TracySystem.cpp index ca944334..87b1b0c7 100644 --- a/public/common/TracySystem.cpp +++ b/public/common/TracySystem.cpp @@ -374,9 +374,11 @@ TRACY_API const char* GetUserFullName() #if defined TRACY_HAS_CUSTOM_USER_INFO return PlatformGetUserFullName(); #elif defined _WIN32 +# if !defined TRACY_WIN32_NO_DESKTOP static char buf[1024]; ULONG size = sizeof( buf ); if( GetUserNameExA( NameDisplay, buf, &size ) ) return buf; +# endif return nullptr; #elif defined __ANDROID__ const auto passwd = getpwuid( getuid() );