mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-13 04:44:39 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user