Fix building Tracy for Switch

This commit is contained in:
Wojtek Figat
2025-07-15 19:31:07 +02:00
parent 7fd278a689
commit 2754d61c05
2 changed files with 8 additions and 2 deletions

View File

@@ -1480,7 +1480,7 @@ Profiler::Profiler()
m_safeSendBuffer = (char*)tracy_malloc( SafeSendBufferSize );
#ifndef _WIN32
#ifndef TRACY_NO_PIPE
pipe(m_pipe);
# if defined __APPLE__ || defined BSD
// FreeBSD/XNU don't have F_SETPIPE_SZ, so use the default
@@ -1642,7 +1642,7 @@ Profiler::~Profiler()
tracy_free( m_kcore );
#endif
#ifndef _WIN32
#ifndef TRACY_NO_PIPE
close( m_pipe[0] );
close( m_pipe[1] );
#endif
@@ -3139,6 +3139,8 @@ char* Profiler::SafeCopyProlog( const char* data, size_t size )
{
success = false;
}
#elif !defined(TRACY_NO_PIPE)
memcpy(buf, data, size);
#else
// Send through the pipe to ensure safe reads
for( size_t offset = 0; offset != size; /*in loop*/ )

View File

@@ -47,11 +47,15 @@ public class tracy : ThirdPartyModule
switch (options.Platform.Target)
{
case TargetPlatform.Windows:
case TargetPlatform.XboxOne:
case TargetPlatform.XboxScarlett:
options.PrivateDefinitions.Add("TRACY_DBGHELP_LOCK=FlaxDbgHelp");
options.PrivateDefinitions.Add("TRACY_NO_PIPE");
break;
case TargetPlatform.Switch:
options.PrivateDefinitions.Add("TRACY_USE_MALLOC");
options.PrivateDefinitions.Add("TRACY_ONLY_IPV4");
options.PrivateDefinitions.Add("TRACY_NO_PIPE");
break;
}
}