From 11fa96cce1df9687fd76a8fd59a20778270e473d Mon Sep 17 00:00:00 2001 From: sof Date: Fri, 7 Aug 1998 09:18:10 +0000 Subject: [PATCH] [project @ 1998-08-07 09:18:10 by sof] segv_handler: additional cpp'ery to account for the fact that sigcontext_struct was renamed to sigcontext in 2.1.x Linux kernels. --- ghc/runtime/main/Signals.lc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ghc/runtime/main/Signals.lc b/ghc/runtime/main/Signals.lc index 5bed26d..2f376ae 100644 --- a/ghc/runtime/main/Signals.lc +++ b/ghc/runtime/main/Signals.lc @@ -76,7 +76,9 @@ much pain. # ifndef LINUX_VERSION_CODE # include # endif -# if (LINUX_VERSION_CODE < 0x020000) +/* Snaffled from drivers/scsi/eata.c in 2.0.30 sources */ +#define LinuxVersionCode(v, p, s) (((v)<<16)+((p)<<8)+(s)) +# if ( LINUX_VERSION_CODE < LinuxVersionCode(2,0,0) ) # include # else # include @@ -133,7 +135,21 @@ segv_handler(int sig, # if defined(aix_TARGET_OS) int code, struct sigcontext *scp) # else /* linux */ + /* sigcontext_struct has been renamed to sigcontext. If + compiling this code elicits a bunch of warnings about + "struct sigcontext_struct" being undeclared, check to + see whether you've got "struct sigcontext" in . + or not. + + If you do, lower the version number below to fit the version + you're running (and pass us a note saying that you had to - thx!) + */ +# if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,51) + /* sigcontext_struct has been renamed to sigcontext */ + struct sigcontext scp) +# else struct sigcontext_struct scp) +# endif # endif # endif { -- 1.7.10.4