From 93578e24376da1081ec55c2b27028540d76a5a2e Mon Sep 17 00:00:00 2001 From: Milan Nikolic Date: Thu, 3 Sep 2020 23:22:07 +0200 Subject: [PATCH] Fix Android --- examples/others/android/example/README.md | 2 +- raylib/core.c | 3 ++- raylib/platform_android.c | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/others/android/example/README.md b/examples/others/android/example/README.md index 9351ff8..67448ca 100644 --- a/examples/others/android/example/README.md +++ b/examples/others/android/example/README.md @@ -18,7 +18,7 @@ Export sysroot path: And compile shared library: CC=arm-linux-androideabi-gcc \ - CGO_CFLAGS="-I${ANDROID_SYSROOT}/usr/include --sysroot=${ANDROID_SYSROOT}" \ + CGO_CFLAGS="-I${ANDROID_SYSROOT}/usr/include --sysroot=${ANDROID_SYSROOT} -D__ANDROID_API__=16" \ CGO_LDFLAGS="-L${ANDROID_SYSROOT}/usr/lib --sysroot=${ANDROID_SYSROOT}" \ CGO_ENABLED=1 GOOS=android GOARCH=arm \ go build -buildmode=c-shared -ldflags="-s -w -extldflags=-Wl,-soname,libexample.so" \ diff --git a/raylib/core.c b/raylib/core.c index 1e6fdf5..9083d08 100644 --- a/raylib/core.c +++ b/raylib/core.c @@ -549,7 +549,8 @@ static void *GamepadThread(void *arg); // Mouse reading thread #if defined(PLATFORM_ANDROID) // To allow easier porting to android, we allow the user to define a // main function which we call from android_main, defined by ourselves -extern int main(int argc, char *argv[]); +//extern int main(int argc, char *argv[]); +extern void android_run(); void android_main(struct android_app *app) { diff --git a/raylib/platform_android.c b/raylib/platform_android.c index 83be1d0..1e5574b 100644 --- a/raylib/platform_android.c +++ b/raylib/platform_android.c @@ -2,6 +2,8 @@ #include "_cgo_export.h" +struct android_app *GetAndroidApp(); + void android_init() { struct android_app *app; app = GetAndroidApp();