Fix clang compile

This commit is contained in:
JusicP
2021-04-28 18:24:16 +03:00
parent c70e496e72
commit d349b1769a
15 changed files with 65 additions and 47 deletions
+3 -1
View File
@@ -386,7 +386,7 @@ DBG_INTERFACE bool ShouldUseNewAssertDialog()
#endif // DBGFLAG_ASSERTDLG
}
#if defined( POSIX )
#if defined( POSIX ) && !defined ( ANDROID )
#include <execinfo.h>
@@ -441,7 +441,9 @@ DBG_INTERFACE bool DoNewAssertDialog( const tchar *pFilename, int line, const tc
pFilename, line, pExpression);
if ( getenv( "POSIX_ASSERT_BACKTRACE" ) )
{
#if !defined ( ANDROID )
SpewBacktrace();
#endif
}
}
else
+4
View File
@@ -124,9 +124,13 @@ float GetCPUUsage()
float GetCPUUsage()
{
#ifdef ANDROID
return 0;
#else
double loadavg[3];
getloadavg( loadavg, 3 );
return loadavg[0];
#endif
}
#endif //POSIX
+3 -3
View File
@@ -1,4 +1,4 @@
//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
//===== Copyright 1996-2005, Valve Corporation, All rights reserved. ======//
//
// Purpose:
//
@@ -27,7 +27,7 @@
#include <set>
#endif
#if defined( LINUX )
#if defined( LINUX ) && !defined( ANDROID )
#include <execinfo.h>
#endif
@@ -38,7 +38,7 @@
#if !defined( ENABLE_RUNTIME_STACK_TRANSLATION ) //disable the whole toolset
#if defined( LINUX )
#if defined( LINUX ) && !defined( ANDROID )
int GetCallStack( void **pReturnAddressesOut, int iArrayCount, int iSkipCount )
{
+2
View File
@@ -2034,6 +2034,8 @@ void CThread::Yield()
{
#ifdef _WIN32
::Sleep(0);
#elif defined(ANDROID)
sched_yield();
#elif defined(POSIX)
pthread_yield();
#endif