For PR351:
authorReid Spencer <rspencer@reidspencer.com>
Mon, 27 Dec 2004 06:16:52 +0000 (06:16 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Mon, 27 Dec 2004 06:16:52 +0000 (06:16 +0000)
* 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

lib/System/Unix/MappedFile.cpp
lib/System/Unix/MappedFile.inc
lib/System/Unix/Program.cpp
lib/System/Unix/Program.inc
lib/System/Unix/Signals.cpp
lib/System/Unix/Signals.inc

index 36a17e0f2c4b9535fff18a04ee07d99916575f0b..07683c1439270d16527f6bbefd971168b5f17905 100644 (file)
 //===          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;
index 36a17e0f2c4b9535fff18a04ee07d99916575f0b..07683c1439270d16527f6bbefd971168b5f17905 100644 (file)
 //===          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;
index 18cbc33d8417c6fddb210c561a794e3f5e560d4c..1bd3eae0f97abe5396ec0eefd0cf89d8b28bc60d 100644 (file)
 
 #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;
 
index 18cbc33d8417c6fddb210c561a794e3f5e560d4c..1bd3eae0f97abe5396ec0eefd0cf89d8b28bc60d 100644 (file)
 
 #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;
 
index 8a3eee13436a7aeaecdf5952fb707f91a5ba9cb2..c6952298f4375e590ca47d94981fe23e64cf80c3 100644 (file)
 #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 {
 
index 8a3eee13436a7aeaecdf5952fb707f91a5ba9cb2..c6952298f4375e590ca47d94981fe23e64cf80c3 100644 (file)
 #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 {