cvs diff for review: support for Linux 2.1.x
Fergus Henderson
fjh at hydra.cs.mu.oz.au
Thu Mar 6 13:49:25 AEDT 1997
Hi Tom,
Can you please review the following change?
configure.in:
runtime/memory.c:
boehm_gc/os_dep.c:
Add `#define sigcontext_struct sigcontext', because on Linux 2.1.x
the name has changed from `struct sigcontext_struct' to
`struct sigcontext'.
Index: configure.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/configure.in,v
retrieving revision 1.85
diff -u -r1.85 configure.in
--- configure.in 1997/02/26 14:31:09 1.85
+++ configure.in 1997/03/06 02:49:35
@@ -298,6 +298,9 @@
AC_CACHE_VAL(mercury_cv_sigcontext_struct,
mercury_cv_sigcontext_struct=no
AC_TRY_RUN([
+/* see runtime/memory.c for documentation of this code */
+
+#define sigcontext_struct sigcontext
#define __KERNEL__
#include <signal.h>
@@ -341,6 +344,10 @@
AC_CACHE_VAL(mercury_cv_pc_access,
mercury_cv_pc_access=no
AC_TRY_RUN([
+ /* see runtime/memory.c for documentation of this code */
+
+ #define sigcontext_struct sigcontext
+
#define __KERNEL__
#include <signal.h>
#undef __KERNEL__
Index: runtime/memory.c
===================================================================
RCS file: /home/staff/zs/imp/mercury/runtime/memory.c,v
retrieving revision 1.67
diff -u -r1.67 memory.c
--- memory.c 1997/02/16 12:05:54 1.67
+++ memory.c 1997/03/06 02:47:35
@@ -29,11 +29,17 @@
/*---------------------------------------------------------------------------*/
-#include "regs.h" /* must come first, due to gloabl register vars */
+#include "regs.h" /* must come first, due to global register vars */
#include "conf.h" /* must come second */
#ifdef HAVE_SIGCONTEXT_STRUCT
/*
+ ** Some versions of Linux call it struct sigcontext_struct, some call it
+ ** struct sigcontext. The following #define eliminates the differences.
+ */
+ #define sigcontext_struct sigcontext /* must be before #include <signal.h> */
+
+ /*
** On some systems (e.g. most versions of Linux) we need to #define
** __KERNEL__ to get sigcontext_struct from <signal.h>.
** This stuff must come before anything else that might include <signal.h>,
@@ -43,6 +49,10 @@
#include <signal.h> /* must come third */
#undef __KERNEL__
+ /*
+ ** Some versions of Linux define it in <signal.h>, others define it in
+ ** <asm/sigcontext.h>. We try both.
+ */
#ifdef HAVE_ASM_SIGCONTEXT
#include <asm/sigcontext.h>
#endif
Index: boehm_gc/os_dep.c
===================================================================
RCS file: /home/staff/zs/imp/mercury/boehm_gc/os_dep.c,v
retrieving revision 1.8
diff -u -r1.8 os_dep.c
--- os_dep.c 1997/02/01 09:09:35 1.8
+++ os_dep.c 1997/03/06 02:16:33
@@ -16,6 +16,9 @@
# include "gc_priv.h"
# ifdef LINUX
+ /* For Linux 2.1.x, `struct sigcontext_struct' has been renamed as */
+ /* `struct sigcontext'; hence the following #define. */
+# define sigcontext_struct sigcontext
/* Ugly hack to get struct sigcontext_struct definition. Required */
/* for some early 1.3.X releases. Will hopefully go away soon. */
/* in some later Linux releases, asm/sigcontext.h may have to */
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
More information about the developers
mailing list