From: Reid Spencer Date: Mon, 27 Dec 2004 06:16:52 +0000 (+0000) Subject: For PR351: X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cdf54d04c7623d8440356c7c0dd0b6413dc0dda4;p=oota-llvm.git For PR351: * 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 --- diff --git a/lib/System/Unix/MappedFile.cpp b/lib/System/Unix/MappedFile.cpp index 36a17e0f2c4..07683c14392 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 +#endif + +#ifdef HAVE_SYS_MMAN_H #include +#endif + +#ifdef HAVE_SYS_STAT_H +#include +#endif namespace llvm { using namespace sys; diff --git a/lib/System/Unix/MappedFile.inc b/lib/System/Unix/MappedFile.inc index 36a17e0f2c4..07683c14392 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 +#endif + +#ifdef HAVE_SYS_MMAN_H #include +#endif + +#ifdef HAVE_SYS_STAT_H +#include +#endif namespace llvm { using namespace sys; diff --git a/lib/System/Unix/Program.cpp b/lib/System/Unix/Program.cpp index 18cbc33d841..1bd3eae0f97 100644 --- a/lib/System/Unix/Program.cpp +++ b/lib/System/Unix/Program.cpp @@ -18,13 +18,16 @@ #include #include "Unix.h" +#include +#if HAVE_SYS_STAT_H #include +#endif +#if HAVE_SIGNAL_H #include +#endif +#if HAVE_FCNTL_H #include -#ifdef HAVE_SYS_WAIT_H -#include #endif -#include extern char** environ; diff --git a/lib/System/Unix/Program.inc b/lib/System/Unix/Program.inc index 18cbc33d841..1bd3eae0f97 100644 --- a/lib/System/Unix/Program.inc +++ b/lib/System/Unix/Program.inc @@ -18,13 +18,16 @@ #include #include "Unix.h" +#include +#if HAVE_SYS_STAT_H #include +#endif +#if HAVE_SIGNAL_H #include +#endif +#if HAVE_FCNTL_H #include -#ifdef HAVE_SYS_WAIT_H -#include #endif -#include extern char** environ; diff --git a/lib/System/Unix/Signals.cpp b/lib/System/Unix/Signals.cpp index 8a3eee13436..c6952298f43 100644 --- a/lib/System/Unix/Signals.cpp +++ b/lib/System/Unix/Signals.cpp @@ -15,11 +15,12 @@ #include "Unix.h" #include #include -#ifdef HAVE_EXECINFO_H +#if HAVE_EXECINFO_H # include // For backtrace(). #endif -#include +#if HAVE_SIGNAL_H #include +#endif namespace { diff --git a/lib/System/Unix/Signals.inc b/lib/System/Unix/Signals.inc index 8a3eee13436..c6952298f43 100644 --- a/lib/System/Unix/Signals.inc +++ b/lib/System/Unix/Signals.inc @@ -15,11 +15,12 @@ #include "Unix.h" #include #include -#ifdef HAVE_EXECINFO_H +#if HAVE_EXECINFO_H # include // For backtrace(). #endif -#include +#if HAVE_SIGNAL_H #include +#endif namespace {