From f36f9d290d7f6632851612aeb14d27226b1a777a Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 27 Dec 2024 22:43:49 +0100 Subject: [PATCH] [ANDROID] Fix build --- src/include/signals.h | 20 ++++++++++---------- src/libtools/signals.c | 4 ---- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/include/signals.h b/src/include/signals.h index a068ffbfb..1a2a9b396 100644 --- a/src/include/signals.h +++ b/src/include/signals.h @@ -14,27 +14,27 @@ typedef struct x64_sigaction_s { void (*sa_restorer)(void); } x64_sigaction_t; -#ifdef ANDROID -typedef struct android_sigaction_s { - int sa_flags; +typedef struct x64_sigaction_restorer_s { union { sighandler_t _sa_handler; void (*_sa_sigaction)(int, siginfo_t *, void *); } _u; - sigset_t sa_mask; + uint32_t sa_flags; void (*sa_restorer)(void); -} android_sigaction_t; -#endif + sigset_t sa_mask; +} x64_sigaction_restorer_t; -typedef struct x64_sigaction_restorer_s { +#ifdef ANDROID +typedef struct android_sigaction_s { + int sa_flags; union { sighandler_t _sa_handler; void (*_sa_sigaction)(int, siginfo_t *, void *); } _u; - uint32_t sa_flags; - void (*sa_restorer)(void); sigset_t sa_mask; -} x64_sigaction_restorer_t; + void (*sa_restorer)(void); +} android_sigaction_t; +#endif #ifdef BOX32 typedef struct __attribute__((packed)) i386_sigaction_s { diff --git a/src/libtools/signals.c b/src/libtools/signals.c index 81250766b..127f187e8 100644 --- a/src/libtools/signals.c +++ b/src/libtools/signals.c @@ -2129,11 +2129,7 @@ int EXPORT my___sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, #endif __attribute__((alias("my_sigaction"))); -#ifdef ANDROID -int EXPORT my_syscall_rt_sigaction(x64emu_t* emu, int signum, const android_sigaction_restorer_t *act, android_sigaction_restorer_t *oldact, int sigsetsize) -#else int EXPORT my_syscall_rt_sigaction(x64emu_t* emu, int signum, const x64_sigaction_restorer_t *act, x64_sigaction_restorer_t *oldact, int sigsetsize) -#endif { printf_log(LOG_DEBUG, "Syscall/Sigaction(signum=%d, act=%p, old=%p, size=%d)\n", signum, act, oldact, sigsetsize); if(signum<0 || signum>MAX_SIGNAL) {