aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/System/Unix/MappedFile.cpp12
-rw-r--r--lib/System/Unix/MappedFile.inc12
-rw-r--r--lib/System/Unix/Program.cpp9
-rw-r--r--lib/System/Unix/Program.inc9
-rw-r--r--lib/System/Unix/Signals.cpp5
-rw-r--r--lib/System/Unix/Signals.inc5
6 files changed, 40 insertions, 12 deletions
diff --git a/lib/System/Unix/MappedFile.cpp b/lib/System/Unix/MappedFile.cpp
index 36a17e0..07683c1 100644
--- a/lib/System/Unix/MappedFile.cpp
+++ b/lib/System/Unix/MappedFile.cpp
@@ -16,10 +16,20 @@
//=== is guaranteed to work on *all* UNIX variants.
//===----------------------------------------------------------------------===//
-#include "llvm/System/Process.h"
#include "Unix.h"
+#include "llvm/System/Process.h"
+
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif
+
+#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
namespace llvm {
using namespace sys;
diff --git a/lib/System/Unix/MappedFile.inc b/lib/System/Unix/MappedFile.inc
index 36a17e0..07683c1 100644
--- a/lib/System/Unix/MappedFile.inc
+++ b/lib/System/Unix/MappedFile.inc
@@ -16,10 +16,20 @@
//=== is guaranteed to work on *all* UNIX variants.
//===----------------------------------------------------------------------===//
-#include "llvm/System/Process.h"
#include "Unix.h"
+#include "llvm/System/Process.h"
+
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif
+
+#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
namespace llvm {
using namespace sys;
diff --git a/lib/System/Unix/Program.cpp b/lib/System/Unix/Program.cpp
index 18cbc33..1bd3eae 100644
--- a/lib/System/Unix/Program.cpp
+++ b/lib/System/Unix/Program.cpp
@@ -18,13 +18,16 @@
#include <llvm/Config/config.h>
#include "Unix.h"
+#include <iostream>
+#if HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif
+#if HAVE_SIGNAL_H
#include <signal.h>
+#endif
+#if HAVE_FCNTL_H
#include <fcntl.h>
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
#endif
-#include <iostream>
extern char** environ;
diff --git a/lib/System/Unix/Program.inc b/lib/System/Unix/Program.inc
index 18cbc33..1bd3eae 100644
--- a/lib/System/Unix/Program.inc
+++ b/lib/System/Unix/Program.inc
@@ -18,13 +18,16 @@
#include <llvm/Config/config.h>
#include "Unix.h"
+#include <iostream>
+#if HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif
+#if HAVE_SIGNAL_H
#include <signal.h>
+#endif
+#if HAVE_FCNTL_H
#include <fcntl.h>
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
#endif
-#include <iostream>
extern char** environ;
diff --git a/lib/System/Unix/Signals.cpp b/lib/System/Unix/Signals.cpp
index 8a3eee1..c695229 100644
--- a/lib/System/Unix/Signals.cpp
+++ b/lib/System/Unix/Signals.cpp
@@ -15,11 +15,12 @@
#include "Unix.h"
#include <vector>
#include <algorithm>
-#ifdef HAVE_EXECINFO_H
+#if HAVE_EXECINFO_H
# include <execinfo.h> // For backtrace().
#endif
-#include <sys/wait.h>
+#if HAVE_SIGNAL_H
#include <signal.h>
+#endif
namespace {
diff --git a/lib/System/Unix/Signals.inc b/lib/System/Unix/Signals.inc
index 8a3eee1..c695229 100644
--- a/lib/System/Unix/Signals.inc
+++ b/lib/System/Unix/Signals.inc
@@ -15,11 +15,12 @@
#include "Unix.h"
#include <vector>
#include <algorithm>
-#ifdef HAVE_EXECINFO_H
+#if HAVE_EXECINFO_H
# include <execinfo.h> // For backtrace().
#endif
-#include <sys/wait.h>
+#if HAVE_SIGNAL_H
#include <signal.h>
+#endif
namespace {