From 53d94a9ed448e643aaa6d5da371a88e9f066946d Mon Sep 17 00:00:00 2001 From: Eliot Miranda Date: Fri, 21 Jun 2024 11:43:20 -0700 Subject: [PATCH] iFix yet another unreasonably failing compilation issue with sa_sigaction, this time on macOS. --- platforms/unix/vm/sqUnixVMProfile.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platforms/unix/vm/sqUnixVMProfile.c b/platforms/unix/vm/sqUnixVMProfile.c index 609c17212a..12d1af1a64 100644 --- a/platforms/unix/vm/sqUnixVMProfile.c +++ b/platforms/unix/vm/sqUnixVMProfile.c @@ -142,10 +142,13 @@ static long pc_buffer_index; static long pc_buffer_size; static long pc_buffer_wrapped; +// The necessity of casting weither the uap argument to ucontext_t *, or to +// declare the parameter as ucontext_t * and cast the assignment to sa_sigaction +// is so wilfully toxic it beggars belief. static void -pcbufferSIGPROFhandler(int sig, siginfo_t *info, ucontext_t *uap) +pcbufferSIGPROFhandler(int sig, siginfo_t *info, void *uap) { - pc_buffer[pc_buffer_index] = uap->_PC_IN_UCONTEXT; + pc_buffer[pc_buffer_index] = ((ucontext_t *)uap)->_PC_IN_UCONTEXT; if (++pc_buffer_index >= pc_buffer_size) { pc_buffer_index = 0; pc_buffer_wrapped = 1;