mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-07 17:29:36 +00:00
Fix code for Android
This commit is contained in:
@@ -341,14 +341,20 @@ bool FileSystem_GetExecutableDir( char *exedir, int exeDirLen )
|
||||
|
||||
Q_FixSlashes( exedir );
|
||||
|
||||
#ifdef ANDROID
|
||||
const char* libDir = "lib";
|
||||
#else
|
||||
const char* libDir = "bin";
|
||||
#endif
|
||||
|
||||
// Return the bin directory as the executable dir if it's not in there
|
||||
// because that's really where we're running from...
|
||||
char ext[MAX_PATH];
|
||||
Q_StrRight( exedir, 4, ext, sizeof( ext ) );
|
||||
if ( ext[0] != CORRECT_PATH_SEPARATOR || Q_stricmp( ext+1, "bin" ) != 0 )
|
||||
if ( ext[0] != CORRECT_PATH_SEPARATOR || Q_stricmp( ext+1, libDir ) != 0 )
|
||||
{
|
||||
Q_strncat( exedir, CORRECT_PATH_SEPARATOR_S, exeDirLen, COPY_ALL_CHARACTERS );
|
||||
Q_strncat( exedir, "bin", exeDirLen, COPY_ALL_CHARACTERS );
|
||||
Q_strncat( exedir, libDir, exeDirLen, COPY_ALL_CHARACTERS );
|
||||
Q_FixSlashes( exedir );
|
||||
}
|
||||
|
||||
|
||||
@@ -392,6 +392,8 @@ extern "C"
|
||||
#ifndef NO_MEMOVERRIDE_NEW_DELETE
|
||||
#ifdef OSX
|
||||
void *__cdecl operator new( size_t nSize ) throw (std::bad_alloc)
|
||||
#elif ANDROID
|
||||
void *__cdecl operator new( size_t nSize ) throw (std::bad_alloc)
|
||||
#else
|
||||
void *__cdecl operator new( size_t nSize )
|
||||
#endif
|
||||
@@ -406,6 +408,8 @@ void *__cdecl operator new( size_t nSize, int nBlockUse, const char *pFileName,
|
||||
|
||||
#ifdef OSX
|
||||
void __cdecl operator delete( void *pMem ) throw()
|
||||
#elif ANDROID
|
||||
void __cdecl operator delete( void *pMem ) throw()
|
||||
#else
|
||||
void __cdecl operator delete( void *pMem )
|
||||
#endif
|
||||
@@ -415,6 +419,8 @@ void __cdecl operator delete( void *pMem )
|
||||
|
||||
#ifdef OSX
|
||||
void operator delete(void*pMem, std::size_t)
|
||||
#elif ANDROID
|
||||
void operator delete(void*pMem, std::size_t)
|
||||
#else
|
||||
void operator delete(void*pMem, std::size_t) throw()
|
||||
#endif
|
||||
@@ -424,6 +430,8 @@ void operator delete(void*pMem, std::size_t) throw()
|
||||
|
||||
#ifdef OSX
|
||||
void *__cdecl operator new[]( size_t nSize ) throw (std::bad_alloc)
|
||||
#elif ANDROID
|
||||
void *__cdecl operator new[]( size_t nSize ) throw (std::bad_alloc)
|
||||
#else
|
||||
void *__cdecl operator new[]( size_t nSize )
|
||||
#endif
|
||||
@@ -438,6 +446,8 @@ void *__cdecl operator new[] ( size_t nSize, int nBlockUse, const char *pFileNam
|
||||
|
||||
#ifdef OSX
|
||||
void __cdecl operator delete[]( void *pMem ) throw()
|
||||
#elif ANDROID
|
||||
void __cdecl operator delete[]( void *pMem ) throw()
|
||||
#else
|
||||
void __cdecl operator delete[]( void *pMem )
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user