[m-rev.] diff: Fix compilation with musl.

Peter Wang novalazy at gmail.com
Sat Aug 11 11:50:49 AEST 2018


musl warns if <sys/signal.h> is included, which now breaks the build due
to --halt-at-warn-if-possible. The comments state that the inclusion was
to work around a problem on FreeBSD, but it is no longer necessary for
FreeBSD 11.

runtime/mercury_memory_handlers.c:
runtime/mercury_memory_zones.c:
    Don't include <sys/signal.h>

diff --git a/runtime/mercury_memory_handlers.c b/runtime/mercury_memory_handlers.c
index 6bc867b73..cc30a2222 100644
--- a/runtime/mercury_memory_handlers.c
+++ b/runtime/mercury_memory_handlers.c
@@ -22,25 +22,20 @@
 
 // This include must come before anything else that might include <signal.h>.
 // See the comments in mercury_signal.h.
 
 #include "mercury_signal.h"
 
 #ifdef MR_HAVE_SYS_SIGINFO_H
   #include <sys/siginfo.h>
 #endif
 
-#ifdef MR_HAVE_SYS_SIGNAL_H
-  // On FREEBSD, we need to include <sys/signal.h> before <ucontext.h>.
-  #include <sys/signal.h>
-#endif
-
 #ifdef  MR_HAVE_MPROTECT
   #include <sys/mman.h>
 #endif
 
 #ifdef  MR_HAVE_UCONTEXT_H
   #include <ucontext.h>
 #endif
 
 #ifdef  MR_HAVE_SYS_UCONTEXT_H
   #include <sys/ucontext.h>
diff --git a/runtime/mercury_memory_zones.c b/runtime/mercury_memory_zones.c
index 06db767e1..8d7ec67ab 100644
--- a/runtime/mercury_memory_zones.c
+++ b/runtime/mercury_memory_zones.c
@@ -32,25 +32,20 @@
 #include <stdlib.h>         // for memalign and posix_memalign
 
 #ifdef MR_HAVE_MALLOC_H
     #include <malloc.h>     // for memalign
 #endif
 
 #ifdef MR_HAVE_SYS_SIGINFO_H
   #include <sys/siginfo.h>
 #endif
 
-#ifdef MR_HAVE_SYS_SIGNAL_H
-  // On FREEBSD we need to include <sys/signal.h> before <ucontext.h>.
-  #include <sys/signal.h>
-#endif
-
 #ifdef  MR_HAVE_MPROTECT
   #include <sys/mman.h>
 #endif
 
 #ifdef  MR_HAVE_UCONTEXT_H
   #include <ucontext.h>
 #endif
 
 #ifdef  MR_HAVE_SYS_UCONTEXT_H
   #include <sys/ucontext.h>
-- 
2.18.0



More information about the reviews mailing list