* Ensure #includes are wrapped with appropriate HAVE_ guards
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19156
91177308-0d34-0410-b5e6-
96231b3b80d8
//=== 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;
//=== 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;
#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;
#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;
#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 {
#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 {