Fix code for Android

This commit is contained in:
JusicP
2021-08-20 19:56:20 +03:00
parent 557c300975
commit 7a91fbebd9
19 changed files with 405 additions and 18 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
#include <dlfcn.h>
#endif
#if defined( USE_SDL )
#if defined( LINUX ) || defined( USE_SDL )
// We lazily load the SDL shared object, and only reference functions if it's
// available, so this can be included on the dedicated server too.
+12
View File
@@ -31,6 +31,10 @@
#include "xbox/xbox_console.h"
#endif
#ifdef ANDROID
#include <android/log.h>
#endif
#include "tier0/etwprof.h"
#ifndef STEAM
@@ -313,6 +317,10 @@ static SpewRetval_t _SpewMessage( SpewType_t spewType, const char *pGroupName, i
ret = s_SpewOutputFunc( spewType, pTempBuffer );
g_pSpewInfo = (int)NULL;
#ifdef ANDROID
__android_log_print( ANDROID_LOG_INFO, "SRCENGINE", "%s", pTempBuffer );
#endif
switch (ret)
{
// Asserts put the break into the macro so it occurs in the right place
@@ -903,6 +911,10 @@ void COM_TimestampedLog( char const *fmt, ... )
XBX_rTimeStampLog( curStamp, string );
#endif
#ifdef ANDROID
__android_log_print( ANDROID_LOG_INFO, "SRCENGINE", "%s", string );
#endif
if ( IsPC() )
{
// If ETW profiling is enabled then do it only.
+3
View File
@@ -28,6 +28,9 @@
#include <time.h>
#include <fcntl.h>
#endif
#ifdef ANDROID
#include <linux/stat.h>
#endif
#include "tier0/memdbgon.h"
// Benchmark mode uses this heavy-handed method
+5
View File
@@ -23,8 +23,13 @@
#elif defined(POSIX)
#if !defined(OSX)
#if defined(ANDROID)
#include <fcntl.h>
#include <unistd.h>
#else
#include <sys/fcntl.h>
#include <sys/unistd.h>
#endif
#define sem_unlink( arg )
#define OS_TO_PTHREAD(x) (x)
#else