[llvm-commits] CVS: llvm/lib/System/Unix/MappedFile.cpp Program.cpp Signals.cpp

Reid Spencer reid at x10sys.com
Sun Dec 26 22:17:03 PST 2004



Changes in directory llvm/lib/System/Unix:

MappedFile.cpp updated: 1.8 -> 1.9
Program.cpp updated: 1.9 -> 1.10
Signals.cpp updated: 1.4 -> 1.5
---
Log message:

For PR351: http://llvm.cs.uiuc.edu/PR351 :
* Ensure #includes are wrapped with appropriate HAVE_ guards


---
Diffs of the changes:  (+20 -6)

Index: llvm/lib/System/Unix/MappedFile.cpp
diff -u llvm/lib/System/Unix/MappedFile.cpp:1.8 llvm/lib/System/Unix/MappedFile.cpp:1.9
--- llvm/lib/System/Unix/MappedFile.cpp:1.8	Sun Dec 12 20:58:51 2004
+++ llvm/lib/System/Unix/MappedFile.cpp	Mon Dec 27 00:16:52 2004
@@ -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;


Index: llvm/lib/System/Unix/Program.cpp
diff -u llvm/lib/System/Unix/Program.cpp:1.9 llvm/lib/System/Unix/Program.cpp:1.10
--- llvm/lib/System/Unix/Program.cpp:1.9	Sun Dec 19 12:58:11 2004
+++ llvm/lib/System/Unix/Program.cpp	Mon Dec 27 00:16:52 2004
@@ -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;
 


Index: llvm/lib/System/Unix/Signals.cpp
diff -u llvm/lib/System/Unix/Signals.cpp:1.4 llvm/lib/System/Unix/Signals.cpp:1.5
--- llvm/lib/System/Unix/Signals.cpp:1.4	Fri Dec 10 18:14:15 2004
+++ llvm/lib/System/Unix/Signals.cpp	Mon Dec 27 00:16:52 2004
@@ -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 {
 






More information about the llvm-commits mailing list