From a753bcb459649d20331d9c9f1dba94588ef56829 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Mon, 11 Dec 2023 09:04:56 +0300 Subject: [PATCH] Fix 'use of undeclared SIGSEGV' on Linux if malloc redirection (fix of commit 54d8c74e1) Issue #588 (bdwgc). * os_dep.c [MPROTECT_VDB && DARWIN || OPENBSD]: Include signal.h. * os_dep.c [NEED_FIND_LIMIT || UNIX_LIKE && !NO_DEBUGGING || USE_PROC_FOR_LIBRARIES && THREADS || WRAP_MARK_SOME && NO_SEH_AVAILABLE]: Likewise. * os_dep.c [MPROTECT_VDB && !MSWINCE]: Do not include signal.h if MSWIN32. --- os_dep.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/os_dep.c b/os_dep.c index 17b74a456..96b3abac7 100644 --- a/os_dep.c +++ b/os_dep.c @@ -17,8 +17,8 @@ #include "private/gc_priv.h" -#if (defined(MPROTECT_VDB) && !defined(DARWIN) && !defined(MSWINCE)) \ - || defined(GC_SOLARIS_THREADS) +#if (defined(MPROTECT_VDB) && !defined(MSWIN32) && !defined(MSWINCE)) \ + || defined(GC_SOLARIS_THREADS) || defined(OPENBSD) # include #endif @@ -873,6 +873,8 @@ GC_INNER void GC_setpagesize(void) || (defined(USE_PROC_FOR_LIBRARIES) && defined(THREADS)) \ || (defined(WRAP_MARK_SOME) && defined(NO_SEH_AVAILABLE)) +# include + # ifdef USE_SEGV_SIGACT # ifndef OPENBSD static struct sigaction old_segv_act;