Skip to content

Commit

Permalink
[ANDROID] Another attempt at fixing the build
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Dec 27, 2024
1 parent f36f9d2 commit fcd46e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
22 changes: 11 additions & 11 deletions src/include/signals.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,37 @@

typedef void (*sighandler_t)(int);

#ifdef ANDROID
typedef struct x64_sigaction_s {
int sa_flags;
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);
} x64_sigaction_t;

typedef struct x64_sigaction_restorer_s {
#else
typedef struct x64_sigaction_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);
sigset_t sa_mask;
} x64_sigaction_restorer_t;
} x64_sigaction_t;
#endif

#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;

#ifdef BOX32
typedef struct __attribute__((packed)) i386_sigaction_s {
Expand Down
8 changes: 0 additions & 8 deletions src/libtools/signals.c
Original file line number Diff line number Diff line change
Expand Up @@ -2064,11 +2064,7 @@ EXPORT sighandler_t my_signal(x64emu_t* emu, int signum, sighandler_t handler)
EXPORT sighandler_t my___sysv_signal(x64emu_t* emu, int signum, sighandler_t handler) __attribute__((alias("my_signal")));
EXPORT sighandler_t my_sysv_signal(x64emu_t* emu, int signum, sighandler_t handler) __attribute__((alias("my_signal"))); // not completely exact

#ifdef ANDROID
int EXPORT my_sigaction(x64emu_t* emu, int signum, const android_sigaction_t *act, android_sigaction_t *oldact)
#else
int EXPORT my_sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x64_sigaction_t *oldact)
#endif
{
printf_log(LOG_DEBUG, "Sigaction(signum=%d, act=%p(f=%p, flags=0x%x), old=%p)\n", signum, act, act?act->_u._sa_handler:NULL, act?act->sa_flags:0, oldact);
if(signum<0 || signum>MAX_SIGNAL) {
Expand Down Expand Up @@ -2122,11 +2118,7 @@ int EXPORT my_sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x
}
return ret;
}
#ifdef ANDROID
int EXPORT my___sigaction(x64emu_t* emu, int signum, const android_sigaction_t *act, android_sigaction_t *oldact)
#else
int EXPORT my___sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x64_sigaction_t *oldact)
#endif
__attribute__((alias("my_sigaction")));

int EXPORT my_syscall_rt_sigaction(x64emu_t* emu, int signum, const x64_sigaction_restorer_t *act, x64_sigaction_restorer_t *oldact, int sigsetsize)
Expand Down

0 comments on commit fcd46e2

Please sign in to comment.