From: Bruno Haible Date: Mon, 28 Apr 2025 15:47:37 +0000 (+0200) Subject: sigsegv: Fix compilation error on Mac OS X 10.4/powerpc. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=cdddbed4e8745a1130cd3958d3d61639444ebe09;p=gnulib.git sigsegv: Fix compilation error on Mac OS X 10.4/powerpc. Patch by Evan Miller in . * lib/sigsegv.c (SIGSEGV_FAULT_STACKPOINTER) [macOS/powerpc: On Mac OS X <= 10.4, assume struct field names without underscores. --- diff --git a/ChangeLog b/ChangeLog index 04a7c7e023..bd50776c9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2025-04-28 Bruno Haible + + sigsegv: Fix compilation error on Mac OS X 10.4/powerpc. + Patch by Evan Miller in + . + * lib/sigsegv.c (SIGSEGV_FAULT_STACKPOINTER) [macOS/powerpc: On Mac OS X + <= 10.4, assume struct field names without underscores. + 2025-04-28 Bruno Haible threadlib: Avoid multi-dimensional pattern matching. diff --git a/lib/sigsegv.c b/lib/sigsegv.c index d0519814eb..6d08999075 100644 --- a/lib/sigsegv.c +++ b/lib/sigsegv.c @@ -684,7 +684,12 @@ int libsigsegv_version = LIBSIGSEGV_VERSION; - 'ucontext_t' and 'struct __darwin_ucontext' in , - 'struct __darwin_mcontext' in , and - 'struct __darwin_ppc_thread_state' in . */ -# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext->__ss.__r1 +# if !(defined _STRUCT_MCONTEXT || defined _STRUCT_MCONTEXT32 || defined _STRUCT_MCONTEXT64) +/* Mac OS X 10.4 and earlier omitted the underscores. */ +# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext->ss.r1 +# else +# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext->__ss.__r1 +# endif # endif