summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Unix/Path.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-12-27 06:17:15 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-12-27 06:17:15 +0000
commitd103e0851cebe1a3fb32f8a26464d6b859608af7 (patch)
tree024d24820a3e4f73787ab9945b0788d02831b79e /llvm/lib/System/Unix/Path.cpp
parent47cd653411e4fb9df1619783d460a37b994f9110 (diff)
downloadbcm5719-llvm-d103e0851cebe1a3fb32f8a26464d6b859608af7.tar.gz
bcm5719-llvm-d103e0851cebe1a3fb32f8a26464d6b859608af7.zip
For PR351:
* Ensure #includes are wrapped with appropriate HAVE_ guards * Ensure variations in "dirent" structure are accounted for. llvm-svn: 19158
Diffstat (limited to 'llvm/lib/System/Unix/Path.cpp')
-rw-r--r--llvm/lib/System/Unix/Path.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/llvm/lib/System/Unix/Path.cpp b/llvm/lib/System/Unix/Path.cpp
index f1d6938e31f..99923335c5a 100644
--- a/llvm/lib/System/Unix/Path.cpp
+++ b/llvm/lib/System/Unix/Path.cpp
@@ -18,11 +18,35 @@
#include "llvm/Config/alloca.h"
#include "Unix.h"
+#if HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif
+#if HAVE_FCNTL_H
#include <fcntl.h>
+#endif
+#if HAVE_UTIME_H
#include <utime.h>
-#include <dirent.h>
+#endif
+#if HAVE_TIME_H
#include <time.h>
+#endif
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# if HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+# include <ndir.h>
+# endif
+#endif
+
namespace llvm {
using namespace sys;
OpenPOWER on IntegriCloud