about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <seebastien.chev@gmail.com>2023-09-02 12:21:39 +0200
committerptitSeb <seebastien.chev@gmail.com>2023-09-02 12:21:39 +0200
commit90ad1653590dab359d1b8acb41faccd3c8039a0c (patch)
tree19cf2b051b10dee15d78dec79e7d979c294bc51a /src
parent30eae8f513a01c400a7b1f7baf9978fd2a5fc27d (diff)
downloadbox64-90ad1653590dab359d1b8acb41faccd3c8039a0c.tar.gz
box64-90ad1653590dab359d1b8acb41faccd3c8039a0c.zip
[ANDROID] This should fix Dynarec build on Android
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/dynablock.c2
-rw-r--r--src/dynarec/dynarec.c4
-rw-r--r--src/emu/x64emu_private.h8
3 files changed, 10 insertions, 4 deletions
diff --git a/src/dynarec/dynablock.c b/src/dynarec/dynablock.c
index 114479bc..2113bd2d 100644
--- a/src/dynarec/dynablock.c
+++ b/src/dynarec/dynablock.c
@@ -171,7 +171,7 @@ dynablock_t *AddNewDynablock(uintptr_t addr)
 }
 
 //TODO: move this to dynrec_arm.c and track allocated structure to avoid memory leak
-static __thread struct __jmp_buf_tag dynarec_jmpbuf;
+static __thread JUMPBUFF dynarec_jmpbuf;
 
 void cancelFillBlock()
 {
diff --git a/src/dynarec/dynarec.c b/src/dynarec/dynarec.c
index 77ca980c..a0084a8e 100644
--- a/src/dynarec/dynarec.c
+++ b/src/dynarec/dynarec.c
@@ -103,9 +103,9 @@ void DynaCall(x64emu_t* emu, uintptr_t addr)
 void DynaRun(x64emu_t* emu)
 {
     // prepare setjump for signal handling
-    struct __jmp_buf_tag jmpbuf[1] = {0};
+    JUMPBUFF jmpbuf[1] = {0};
     int skip = 0;
-    struct __jmp_buf_tag *old_jmpbuf = emu->jmpbuf;
+    JUMPBUFF *old_jmpbuf = emu->jmpbuf;
     emu->flags.jmpbuf_ready = 0;
 
     while(!(emu->quit)) {
diff --git a/src/emu/x64emu_private.h b/src/emu/x64emu_private.h
index 8076049d..701d5add 100644
--- a/src/emu/x64emu_private.h
+++ b/src/emu/x64emu_private.h
@@ -44,6 +44,12 @@ typedef struct emu_flags_s {
     uint32_t    jmpbuf_ready:1;   // the jmpbuf in the emu is ok and don't need refresh
 } emu_flags_t;
 
+#ifdef ANDROID
+#define JUMPBUFF sigjmp_buf
+#else
+#define JUMPBUFF struct __jmp_buf_tag
+#endif
+
 typedef struct x64emu_s {
     // cpu
 	reg64_t     regs[16];
@@ -104,7 +110,7 @@ typedef struct x64emu_s {
     void*       stack2free; // this is the stack to free (can be NULL)
     void*       init_stack; // initial stack (owned or not)
     uint32_t    size_stack; // stack size (owned or not)
-    struct __jmp_buf_tag *jmpbuf;
+    JUMPBUFF*   jmpbuf;
 
     x64_ucontext_t *uc_link; // to handle setcontext