From 396d18ff3b00b3e3e3f7508878db3f07741a19a0 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 23 May 2025 07:38:28 +1000 Subject: [PATCH] Symbian: Fix not compiling, fix crashing from using Waitable, drbug printing --- .github/workflows/build_android.yml | 9 +++++++-- src/Core.h | 1 - src/Platform_Symbian.cpp | 20 ++++++++++---------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_android.yml b/.github/workflows/build_android.yml index c2e4540c6..9c1069185 100644 --- a/.github/workflows/build_android.yml +++ b/.github/workflows/build_android.yml @@ -1,5 +1,11 @@ name: Build latest (Android2) -on: [push] +# trigger via either push to selected branches or on manual run +on: + push: + branches: + - main + - master + workflow_dispatch: concurrency: group: ${{ github.ref }}-android @@ -7,7 +13,6 @@ concurrency: jobs: build: - if: github.ref_name == github.event.repository.default_branch runs-on: ubuntu-latest container: image: ghcr.io/saschpe/android-ndk:34-jdk17.0.8_7-ndk25.2.9519653-cmake3.22.1 diff --git a/src/Core.h b/src/Core.h index 9c612f0cb..10b4a062a 100644 --- a/src/Core.h +++ b/src/Core.h @@ -554,7 +554,6 @@ typedef cc_uint8 cc_bool; #elif defined __SYMBIAN32__ #define CC_BUILD_SYMBIAN #define CC_BUILD_MOBILE - #define CC_BUILD_POSIX #define CC_BUILD_GLES #define CC_BUILD_EGL #define CC_BUILD_MAXSTACK (16 * 1024) diff --git a/src/Platform_Symbian.cpp b/src/Platform_Symbian.cpp index 4f135725d..622da9a9b 100644 --- a/src/Platform_Symbian.cpp +++ b/src/Platform_Symbian.cpp @@ -40,6 +40,7 @@ extern "C" { #include } #include +#include #include const cc_result ReturnCode_FileShareViolation = 1000000000; /* TODO: not used apparently */ @@ -86,10 +87,15 @@ void Mem_Free(void* mem) { *------------------------------------------------------Logging/Time-------------------------------------------------------* *#########################################################################################################################*/ void Platform_Log(const char* msg, int len) { - int ret; - /* Avoid "ignoring return value of 'write' declared with attribute 'warn_unused_result'" warning */ - ret = write(STDOUT_FILENO, msg, len); - ret = write(STDOUT_FILENO, "\n", 1); + TPtrC8 ptr((const TUint8*)msg, len); + cc_string str; + + str = String_Init(msg, len, len); + Logger_Log(&str); + str = String_FromReadonly("\r\n"); + Logger_Log(&str); + + RDebug::RawPrint(ptr); } TimeMS DateTime_CurrentUTC(void) { @@ -372,23 +378,17 @@ void Waitable_Free(void* handle) { void Waitable_Signal(void* handle) { RSemaphore* sem = (RSemaphore*)handle; - sem->Signal(); - delete sem; } void Waitable_Wait(void* handle) { RSemaphore* sem = (RSemaphore*)handle; - sem->Wait(); - delete sem; } void Waitable_WaitFor(void* handle, cc_uint32 milliseconds) { RSemaphore* sem = (RSemaphore*)handle; - sem->Wait(milliseconds * 1000); - delete sem; }