Misc: Build fixes for Android

This commit is contained in:
Stenzek
2023-11-01 01:32:29 +10:00
parent 538266aacd
commit f05ff4103e
27 changed files with 197 additions and 184 deletions

View File

@ -640,13 +640,6 @@ int FileSystem::OpenFDFile(const char* filename, int flags, int mode, Error* err
#endif
}
#endif
FileSystem::ManagedCFilePtr FileSystem::OpenManagedCFile(const char* filename, const char* mode, Error* error)
{
return ManagedCFilePtr(OpenCFile(filename, mode, error));
}
std::FILE* FileSystem::OpenSharedCFile(const char* filename, const char* mode, FileShareMode share_mode, Error* error)
{
#ifdef _WIN32
@ -687,6 +680,13 @@ std::FILE* FileSystem::OpenSharedCFile(const char* filename, const char* mode, F
#endif
}
#endif
FileSystem::ManagedCFilePtr FileSystem::OpenManagedCFile(const char* filename, const char* mode, Error* error)
{
return ManagedCFilePtr(OpenCFile(filename, mode, error));
}
FileSystem::ManagedCFilePtr FileSystem::OpenManagedSharedCFile(const char* filename, const char* mode,
FileShareMode share_mode, Error* error)
{

View File

@ -293,7 +293,10 @@ void Log::DebugOutputLogCallback(void* pUserParam, const char* channelName, cons
FormatLogMessageAndPrintW(channelName, functionName, level, message, false, false, true,
[](const std::wstring_view& message) { OutputDebugStringW(message.data()); });
#elif defined(__ANDROID__)
static const int logPriority[LOGLEVEL_COUNT] = {
if (message.empty())
return;
static constexpr int logPriority[LOGLEVEL_COUNT] = {
ANDROID_LOG_INFO, // NONE
ANDROID_LOG_ERROR, // ERROR
ANDROID_LOG_WARN, // WARNING
@ -306,7 +309,7 @@ void Log::DebugOutputLogCallback(void* pUserParam, const char* channelName, cons
ANDROID_LOG_DEBUG, // TRACE
};
__android_log_write(logPriority[level], channelName, message);
__android_log_print(logPriority[level], channelName, "%.*s", static_cast<int>(message.length()), message.data());
#else
#endif
}

View File

@ -272,7 +272,7 @@ bool SharedMemoryMappingArea::Unmap(void* map_base, size_t map_size)
return true;
}
#else
#elif !defined(__ANDROID__)
bool MemMap::MemProtect(void* baseaddr, size_t size, PageProtect mode)
{