Add a forward declaration of `struct sigcontext' to avoid a

Estimated hours taken: 0.5

runtime/mercury_signal.c:
runtime/mercury_memory.c:
runtime/mercury_memory_handlers.c:
        Add a forward declaration of `struct sigcontext' to avoid a
        gcc warning inside <signal.h>.  This is needed since our
        `#define sigcontext_struct sigcontext' hack breaks the Linux
        headers a bit -- it means that an earlier forward declaration
        of `struct sigcontext_struct' won't prevent this warning.
        Also add an XXX comment about the code being duplicated three times.
This commit is contained in:
Fergus Henderson
2000-09-12 19:51:07 +00:00
parent 8a8f0da0c1
commit ada9593c53
3 changed files with 15 additions and 0 deletions

View File

@@ -36,12 +36,17 @@
#include "mercury_imp.h"
/*
** XXX This code is duplicated in three files:
** mercury_memory.c, mercury_memory_handlers.c, and mercury_signal.c.
*/
#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> */
struct sigcontext; /* this forward decl avoids a gcc warning in signal.h */
/*
** On some systems (e.g. most versions of Linux) we need to #define

View File

@@ -22,12 +22,17 @@
#include <stdio.h>
#include <string.h>
/*
** XXX This code is duplicated in three files:
** mercury_memory.c, mercury_memory_handlers.c, and mercury_signal.c.
*/
#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> */
struct sigcontext; /* this forward decl avoids a gcc warning in signal.h */
/*
** On some systems (e.g. most versions of Linux) we need to #define

View File

@@ -12,12 +12,17 @@
#include "mercury_imp.h"
/*
** XXX This code is duplicated in three files:
** mercury_memory.c, mercury_memory_handlers.c, and mercury_signal.c.
*/
#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> */
struct sigcontext; /* this forward decl avoids a gcc warning in signal.h */
/*
** On some systems (e.g. most versions of Linux) we need to #define